git分支、合并的使用记录

 
  a. 创建本地分支
      git branch 1.0.1  #1.0.1分支名称,任意定义
   b. 切换到本地分支
      git checkout 1.0.1
   c. 推送到远程分支
      git commit -m 'test for branch submit'
      git push origin 1.0.1
   d. 修改任意代码后提交到远程分支
      git commit -m 'comment for code change'
      git push origin 1.0.1:1.0.1  (本地分支:远程分支)
      如果在工程在当前分支,可以直接提交到远程分支1.0.1
      git push
   e. 实现合并(分支到主干合并)
      git checkout master
      git merge 1.0.1
      git push origin master
    f. 再次切换到本地分支,并且修改代码,提交到远程分支
      git checkout 1.0.1
      vim build.xml
      git commit -a -m 'test change branch and push'
      git push


慢慢体会到git使用的快捷高效。

相关操作记录在git上,详情猛戳
https://github.com/chenxu111/anttest

猜你喜欢

转载自nbtlxx.iteye.com/blog/1999764