简体   繁体   中英

Merge or rebase changes on branches for pull requests?

Sometimes we fork an upstream project to contribute bug fixes. We check out a new branch, commit changes and send a pull request to upstream. But it may take some time for the pull request to be handled and during this time additional changes may occur in the upstream. In this case, should we merge the new upstream head or rebase our changes on it?

If our repository is private, I think rebase gives a cleaner history. But there is a principle that you shouldn't rebase commits that have been published remotely. When we are using public git servers such as github, does this mean merging is our only choice? Is it recommended that we leave the branch as it is for upstream developers to handle (ie non-fast-forwards)?

如果已经发布了某些内容,则不重新设置基准的原则适用于人们可能正在其工作的分支(例如,主人。...一旦在master上发布了某些东西,就会有很多人在获取,合并它,在其上重新建立基础,等等...所以移动它有点痛苦)...但是大多数功能分支从完成的那一刻起就无法使用(这是您从中创建PR的地方)因此,如果它是一个功能分支,并且没有人在它上面工作,请随时为它重新设置基础。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM