1. 在dev分支上剛開發完項目,執行以下命令:
git add
git commit -m 'dev'
git push -u origin dev
2.切換到test分支上
如果是多人開發,先把遠程代碼pull下來
git pull origin test
如果是單人開發,就沒必要了,但為了保險起見,還是先pull一下
3.然后我們把dev上的代碼合到test上
git merge dev
4.然后查看狀態
git status
On branch master
Your branch is ahead of 'origin/master' by 12 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
上面的意思就是你有12個commit,需要push到遠程test上 (一定不要忘記了)
執行下面命令即可
git push origin test