一.使用Git Bash(msysgit)将Svn的项目迁移到Git上
eg:SVN服务器项目路径: https://WIN-RSNO7T5NI7N/svn/MvcSVN/
1. 创建一个文件夹(MvcGitFromSVN),并使用git bash切换到该文件夹
执行git svn clone https://WIN-RSNO7T5NI7N/svn/MvcSVN/
这时候MvcGitFromSVN文件夹就会多出个文件夹MvcSVN
2. 切换到MvcSVN目录
使用git bash执行(先在github create Repositories)
Git remote add origin https://github.com/mike110/MvcTest
3. 使用git bash执行: git push origin –all
这时候到github页面就可以看到push上去的项目了
二. Git bash更新、提交代码(使用命令版)
1. 获取github上代码
使用git bash切换到一个指定文件夹内
执行: git clonehttps://github.com/mike110/MvcTest
执行完之后,目录下就会出现项目了
2. 更新项目,切换到MvcTest目录下
执行: git pull –all
3. 提交代码
1. 执行git init
2. 执行git add . (.代表所有代码,也可以指定提交某个文件
(eg:’MvcSVN\Views\Home\Index.cshtml’, 也可以指定某个文件夹))
3. 执行git commit –m ‘commit description’
4. 执行git push –all
这时候就可以看到github上的提交信息了
三. Vs2013使用git
1.获取github代码
打开"团队资源管理器"
Clonegit 项目
点击”Clone”,Clone完之后
2. 提交代码
修改过的代码页面会变色, 右键:
选择”Commit andPust” 会提交之后再Push到github上, 之后会提示输入git用户密码,
提交成功之后,github上就可以看到我们提交的信息了
Github页面信息:
打开”团队资源管理器” –->“Home” ---> “Unsynced Commits”
点击 “Pull” 即可更新项目