Git Revert Error Message?

北慕城南 提交于 2019-12-05 08:59:33
sehe

Q. What conflict?

The conflict from merging the reverse patch of that revision, when later revisions changed the same lines of code: a merge conflict

Edit If you are reverting the latest commit, this means that you had local changes (refer to git status). Don't forget that you can have staged and unstaged local changes. To easily see all local changes, use

   git diff HEAD

You should just open up the unmerged file (git status) to see the conflicted file(s). You'll see the <<<<, =====, >>>>> conflict markers soon enough.

You can use

git mergetool

to resolve the conflicts with more user-friendly tools like Meld, KDiff3, Gvim etc.

You're making a confusion between untracked files and unstaged files.

  • Untracked files are unknown to Git, you never git added them (i.e. git status will show them in the Untracked files: section).

  • Unstaged files are tracked files which have local changes, which you did not stage for commit (i.e. git status will show them in the Changes not staged for commit: section). These changes will be included in the next commit if you run git commit -a, but not if you run git commit without -a.

It does not make sense to tell git to ignore unstaged changes: the changes are there, and they touch files that Git cares about.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!