Discard file change during rebase

What I'm looking for is how to check a file during a git merge conflict. The situation I encountered today was during a git reboot that I had to manually merge the file and I messed it up. During normal use of git, I would just issue a git checkout myfile , and I tried this, but the file was still in the state in which I left it. What I wanted in this case is a file in the initial state of merging with conflict markers so that I can give it one more step. I ended up interrupting the replacement and retrying, but I would like something less decisive. What am I missing?

+5
source share
1 answer
 git checkout -m file 

Reproduction of the result (using conflict markers) is a conflicting path file using three versions (basic, ours and them) recorded in the index. With versions of git prior to v1.6.6 (recently released), however, this is only possible until we β€œgit add the file” in mark the path as allowed, and at this point the three versions are dropped from the index and replaced by the merge result.

Link: http://gitster.livejournal.com/43665.html

+4
source

Source: https://habr.com/ru/post/1240459/


All Articles