Git Revert不进行必要的更改

4xrmg8kj  于 2023-11-15  发布在  Git
关注(0)|答案(1)|浏览(106)

我想跑

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

lnvxswe2

lnvxswe21#

事实证明,我实际上在寻找的是git reset。我没有意识到git revert只针对特定的提交。这就是为什么我可以看到其他文件中相同位置的git提交的更改没有被更改。

相关问题