[Git] git merge和rebase的區別


git merge 會生成一個新得合並節點,而rebase不會

比如:

      D---E test
     /
A---B---C---F master

使用merge合並, 為分支合並自動識別出最佳的同源合並點:

      D--------E
     /          \
A---B---C---F----G   test, master

而使用rebase則:

A---B---D---E---C'---F'   test, master  

 使用git pull時默認是merge, 加 --rebase參數使其使用rebase方式

git pull --rebase   

  


免責聲明!

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



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