重新绑定以及通过重新绑定推动提交的意思是什么 [英] Rebasing and what does one mean by rebasing pushed commits
问题描述
您的问题的具体答案可以在标题为重新定义的危险一节中找到。来自该部分的引用:
当你重新编写东西时,你是
放弃现有的提交和
创建新的类似但
不同的那些。如果你在某处推送提交
,并且其他人将它们拉到
并基础工作,然后你
用git rebase
重写那些提交并再次推送它们,你的
合作者将不得不重新合并
他们的工作,而当您尝试将他们的工作转回
时,它们会变得杂乱
。
更新:
根据您的评论,听起来您的Git工作流程存在困难。以下是一些可能有所帮助的参考资料:
-
gitworkflows
手册页:请参阅合并向上和主题分支
- ProGit:请参阅私人管理团队
- Jarrod Spillers博客:参见 git merge vs git rebase:避免Rebase Hell
It is often said that, you should not rebase commits that you have already pushed. What could be meaning of that?
The ProGit book has a good explanation.
The specific answer to your question can be found in the section titled "The Perils of Rebasing". A quote from that section:
When you rebase stuff, you’re abandoning existing commits and creating new ones that are similar but different. If you push commits somewhere and others pull them down and base work on them, and then you rewrite those commits with git rebase and push them up again, your collaborators will have to re-merge their work and things will get messy when you try to pull their work back into yours.
Update:
Based on your comment below, it sounds like your are having difficulty with your Git workflow. Here are some references that may help:
- The
gitworkflows
man page: See "Merging Upwards" and "Topic Branches" - ProGit: See "Private Managed Team"
- Jarrod Spillers blog: See "git merge vs git rebase: Avoiding Rebase Hell"
这篇关于重新绑定以及通过重新绑定推动提交的意思是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!