Git Revert 未进行必要的更改

问题描述 投票:0回答:1

我正在努力奔跑

git revert ######## 

并出现合并冲突。在我的编辑器 (PyCharm) 中解决合并冲突后,我运行

git revert --continue 

然后收到以下消息

On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

You are currently reverting commit ########.
  (all conflicts fixed: run "git revert --continue")
  (use "git revert --skip" to skip this patch)
  (use "git revert --abort" to cancel the revert operation)

nothing to commit, working tree clean

但是,如果我在要恢复的目标提交时查看我的存储库,我可以清楚地看到我的requirements.txt 文件中的差异(并且我确信还有其他文件)。如果我跑步

git revert --continue

再次按照响应/提示中的建议,它将再次呈现相同的响应,

On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

You are currently reverting commit ########.
  (all conflicts fixed: run "git revert --continue")
  (use "git revert --skip" to skip this patch)
  (use "git revert --abort" to cancel the revert operation)

nothing to commit, working tree clean
git github version-control
1个回答
0
投票

事实证明,我真正想要的是 git reset。我没有意识到 git revert 仅适用于特定提交。这就是为什么我可以在 git 提交的同一位置看到其他文件中未更改的更改。

© www.soinside.com 2019 - 2024. All rights reserved.