简体   繁体   English

从拉取请求强制覆盖主服务器?

[英]Force overwrite on master from a pull request?

I've got a pull request on GitHub that's dramatically different than my master (total redesign of the web app) and want to force it to be used as master. 我在GitHub上有一个拉取请求,它与我的主请求有很大的不同(对Web应用程序进行了重新设计),并希望强制将其用作主请求。 It can't automatically be merged because it's so different, but it's the version I want to use as master. 它是如此不同,因此无法自动合并,但这是我要用作母版的版本。

Is there a way to force an overwrite of master with the PR? 有没有办法用PR强制覆盖master?

It's also a branch in the main repo, so if not could I rename that branch to master and get rid of the old master somehow? 它也是主仓库中的一个分支,所以如果不能,我可以将该分支重命名为master并以某种方式摆脱旧的master吗?

Thanks for your help! 谢谢你的帮助!

You can overwrite your current history with the PR branch: 您可以使用PR分支覆盖当前的历史记录:

git fetch <URL of fork>
git push -f origin fork/pr-branch:master

Beware that this will blow away your history and break all forks. 请注意,这将破坏您的历史记录并破坏所有分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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