git pull --rebase,git rebase和git merge之间的区别 [英] Difference between git pull --rebase, git rebase and git merge
问题描述
$ b
git merge
执行合并;详细信息请查看手册页 - 命令有很多选项,这些将在这里解释太多。
git rebase
执行rebase,即重写历史记录。它会将你的提交到与其他分支不同的地方,临时删除它们,从其他分支申请缺少的提交,然后重新提交你的提交。 git rebase
也有一个交互模式,您可以在其中删除/修改/合并(挤压)某些提交。
请查看 http://learn.github.com/p/rebasing.html 以获取关于rebase工作。
Could anyone explain this with keeping even the remote repositories in mind?
git pull --rebase
is the way to go when you want to bring your development branch up to date - those branches are usually not published to others (except maybe for having a look at it) so rewriting history is not a problem and you really don't want merges etc in such a branch.
git merge
performs a merge; see the manpage for details - the comand has tons of options which would be too much to explain here.
git rebase
performs a rebase, i.e. it rewrites history. It will take your commits up to the point where they diverge from the other branch, remove them temporarily, apply the missing commits from the other branch and then re-apply your commits. git rebase
also has an interactive mode where you can remove/modify/combine(squash) certain commits.
Have a look at http://learn.github.com/p/rebasing.html for some nice graphs on how rebases work.
这篇关于git pull --rebase,git rebase和git merge之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!