git pull --rebase,git rebase和git merge之间的区别 [英] Difference between git pull --rebase, git rebase and git merge

查看:194
本文介绍了git pull --rebase,git rebase和git merge之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解释这一点,即使在远程存储库的记住?

解决方案> git pull - -rebase 是您希望将开发分支更新为最新版本的方式 - 这些分支通常不会发布给其他分支(除了可能查看它),因此重写历史记录不是问题,你真的不希望合并等在这样的分支。


$ 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆