简体   繁体   English

撤消拉取请求并将其隐藏

[英]Undo a pull request and stash it

I pulled my 'preprod branch' into my 'master branch' which was 8 commits ahead of master and when I pulled it, It got commited to master but haven't pushed to master yet.我将我的“preprod 分支”拉到我的“主分支”中,该分支比主分支早 8 次提交,当我拉出它时,它已提交给主分支,但尚未推送到主分支。

I want to revert the pull and move those changes to stash to so that I can see all those changes which was there in all 8 commits together and decide whether to push it or not.我想恢复 pull 并将这些更改移动到 stash ,以便我可以看到所有 8 个提交中的所有更改,并决定是否推送它。

I tried git reset --soft HEAD but It is reverting back to last one commit only but I want to undo and stash all those commits(which are 8 commits in this case) which I got from preprod while pulling it into master.我试过git reset --soft HEAD但它只恢复到最后一次提交,但我想撤消并隐藏所有那些提交(在这种情况下是 8 个提交),这些提交是我从 preprod 获得的,同时将其拉入主控。 I can't run the command 8 times also because it undo all the pull requests from other branch also.我也无法运行该命令 8 次,因为它也撤消了来自其他分支的所有拉取请求。

I tried some other commands but nothing is full filling my requirement.我尝试了一些其他命令,但没有完全满足我的要求。 I don't want to pick everything manually and add it.我不想手动选择所有内容并添加它。

You could reset your master to the remote master:您可以将您的主人重置为远程主人:

$ git reset --soft origin/master

And then you can stash these changes if you want:然后,您可以根据需要隐藏这些更改:

$ git stash save

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

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