git-將dev代碼合並到test


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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM