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上,詳情猛戳
[url]https://github.com/chenxu111/anttest[/url]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章