且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Merge和Rebase在Git中的区别

更新时间:2022-09-12 23:32:58

git命令Merge和Rebase的区别

git merge 会生成一个新得合并节点,而rebase不会

比如:

  1.       D---E test  
  2.      /  
  3. A---B---C---F master  


使用merge合并:

  1.       D--------E  
  2.      /          \  
  3. A---B---C---F----G   test, master  


而使用rebase则:

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

 

使用git pull时默认是merge, 加 --rebase参数使其使用rebase方式

  1. git pull --rebase   

 


本文转自邴越博客园博客,原文链接:http://www.cnblogs.com/binyue/p/4610435.html,如需转载请自行联系原作者