将增量项目文件夹作为提交移动到Git [英] Moving incremental project folders to Git as commits

查看:91
本文介绍了将增量项目文件夹作为提交移动到Git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在想迁移到Git时,我拥有一个过时的源代码管理系统.我有同一个项目文件夹的多个副本;每次完成发布/新功能时,我都会复制最新文件夹,增加名称并开始使用该文件夹.不好,但我一直是唯一的开发人员,因此可以使用.我想将项目移到Git,每个文件夹都是一个单独的提交,但是不知道从哪里开始.任何帮助将不胜感激!

I have an archaic source code management system at the moment that I'd like to move to Git. I have multiple copies of the same project folder; each time I complete a release/new feature I copy the latest folder, increment the name and start working on that. It's bad, but I've been the only developer so it works. I'd like to move the project over to Git with each folder being an individual commit, but have no idea where to start. Any help would be appreciated!

推荐答案

这是我想到的唯一方法-这可能需要一些时间...

Here is the only way I can think to do this - it may take a bit of time...

首先,初始化git目录.您可以通过(假设unix/mac os)更改为所需的目录(cd <dir_path>)并从终端运行git init来执行此操作.这是参考.

First, initialize a git directory. You do this by (assuming unix/mac os) changing to the desired directory (cd <dir_path>) and running git init from the terminal. Here is a reference.

接下来,将版本1文件夹的所有内容复制到git目录.完成此操作后,请在终端上运行git .add(这应该将git目录中的所有内容暂存为一次提交).现在您可以提交代码了:git commit -m 'ver 1.0 commit message'.

Next copy all the contents of the version #1 folder to the git directory. Once you have done this run git .add from the terminal (this should stage everything in the git directory for a commit). Now you are ready to commit your code: git commit -m 'ver 1.0 commit message'.

接下来,从您的git目录中删除所有内容(除了.git文件夹!),然后复制版本#2文件夹的所有内容.然后再次运行添加和提交命令.重复直到您使用的是当前版本.

Next delete all the contents (except the .git folder!) from your git directory and then copy in all the contents of the version #2 folder. Then run your add and commit commands again. Repeat until you are on your current version.

完成此操作后,建议您设置某种远程存储库以将项目推送到. GitHub BitBucket 都非常好!

Once you have done this I recommend setting up some sort of remote repository to push your project to. GitHub and BitBucket are both really good!

希望这会有所帮助.

这篇关于将增量项目文件夹作为提交移动到Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆