TortoiseGit:“Stash POP 失败!!!”重复,即使在解决冲突之后

发布于 2025-01-01 22:29:18 字数 861 浏览 0 评论 0原文

我正在使用 TortoiseGit 来处理具有远程源的存储库。我经常必须在一项更改中停下来处理另一项更改,因此我使用存储功能来封锁我搁置的开发,立即进行更改,提交这些更改,推送,然后返回到我的存储。

随着时间的推移,这导致了一些隐藏的更改,我试图立即弹出所有这些更改。

前几个藏品效果很好。是否弹出了一个存储库,提交并重复。然而,最后一个导致错误消息“Stash POP Fail!!!” (天哪!三个感叹号!!!)错误下方的文本表明我尝试弹出的文件之一存在合并冲突。

我做了拉取后遇到冲突时所做的事情:我对冲突文件进行了编辑以解决问题,告诉 git 我已经解决了冲突,最后提交了更改。

然而,进行另一次存储弹出操作会导致相同的错误,并且尝试解决差异表明 git 正在尝试像以前一样从存储中提取相同的更改。当我第二次解决冲突并尝试提交时,git 告诉我什么都没有改变,所以没有什么可以提交的。

最终,为了解决这个问题(并进一步隐藏),我 在 SO 上找到了这个有点类似的问题,并在接受的答案的底部一直采纳了建议。我打开了 git bash 提示符并执行了 git stash drop 来删除导致问题的存储。

我的问题是:

  1. 这是解决问题的最佳方法,还是有一种更直观的方式——理想情况下是一种不会让我担心我会扔掉隐藏的更改的方式?
  2. 如果这是最好的方法,有什么方法可以在 TortoiseGit 中进行隐藏操作吗?我很高兴有 GUI 工具向我展示我正在合并/丢弃的差异,因此尽量避免使用 git 恢复到命令行。

I am using TortoiseGit to work with a repository with a remote origin. I frequently have to stop in the middle of one change to work on another, so I use the stash feature to cordon off development I'm putting on hold, make more immediate changes, commit those, push, and then return to my stash.

Over time, this resulted in several stashed changes, all of which I was attempting to pop off at once.

The first couple of stash pops worked fine. Did a stash pop, committed, and repeated. However, one of the last ones resulted in the error message "Stash POP Fail!!!" (OMG! Three exclamation points!!!) The text below the error indicated one of the files I was attempting to pop had a merge conflict.

I did what I do when I get a conflict after a pull: I made edits to the conflicting file to fix the issues, told git that I had resolved the conflict, and finally committed the change.

Doing another stash pop, however, resulted in the same error, and attempting to resolve the differences showed that git was attempting to pull the same changes out of the stash as before. When I resolved the conflict a second time and attempted to commit, git informed me nothing had changed, and so there was nothing to commit.

Ultimately, to get past this issue (and get to the further-down stashes), I located this somewhat similar problem on SO and took the advice all the way at the bottom of the accepted answer. I opened up a git bash prompt and did a git stash drop to remove the stash that was causing the issue.

My questions are:

  1. Is this the best way to resolve the problem, or is there a more intuitive fashion -- ideally one that doesn't make me worry I'm about to throw away stashed changes?
  2. If this is the best way, is there any way to do a stash drop in TortoiseGit? I appreciate having GUI tools showing me what differences I'm merging/discarding, and so try to avoid reverting to the command line with git.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遥远的绿洲 2025-01-08 22:29:18

从 tortoise 中删除存储

  • 您可以通过“shift”->“右键单击”->“存储列表”然后“右键单击”->“删除”在 tortoise 中删除存储

在您之前检查存储

如果您担心删除包含要保留的更改的存储,您可以使用以下命令将其与当前工作目录进行比较:

  • From tortoise: shift->"right单击“->”存储列表”和“与工作副本比较”

  • 来自命令行:git stash show -p

Dropping a stash from tortoise

  • You can drop a stash in tortoise with "shift"->"right click"->"stash list" and then "right click"->"delete"

Checking the stash before you drop it

If you are worried about dropping a stash with changes you want to keep, you can diff it against your current working directory with:

  • From tortoise: shift->"right click"->"stash list" and "Compare with working copy"

  • From command line: git stash show -p

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文