简体   繁体   English

拉取请求在还原提交后显示大量更改

[英]Pull Request show lot of changes after revert commits

I worked on a branch feature .我在一个分支feature上工作。 I wanted to merge it to develop , so I did pull origin develop in feature before.我想把它合并到develop ,所以我之前在featurepull origin develop

After that, I realized I had to push feature to staging instead of develop .在那之后,我意识到我必须将feature推送到staging而不是develop

So I revert the last two commit and pushed them to the repo.所以我恢复了最后两个提交并将它们推送到回购协议。 But my pull request show me a lot of changes, as if I had did the changes of the merge mysself.但是我的拉取请求显示了很多更改,就好像我自己做了合并的更改一样。

Any workaround?任何解决方法?

So I revert the last two commit and pushed them to the repo所以我恢复了最后两个提交并将它们推送到回购协议

A revert was not necessary: you could reset your staging branch to before the last merge (from the improper pull ), switch branch, and redo the git pull .不需要还原:您可以将暂存分支重置为上次合并之前(来自不正确的pull ),切换分支,然后重做git pull

In your case, if nobody has pushed to staging, you can still reset locally, and force push the staging branch, to restore it to its previous state.在您的情况下,如果没有人推送到暂存,您仍然可以在本地重置,并强制推送暂存分支,以将其恢复到之前的 state。

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

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