How to keep the local file or the remote file during merge using Git and the command line?

后端 未结 4 1297
没有蜡笔的小新
没有蜡笔的小新 2020-12-12 08:45

I know how to merge modification using vimdiff, but, assuming I just know that the entire file is good to keep or to throw away, how do I do that?

I don\'t want to

4条回答
  •  隐瞒了意图╮
    2020-12-12 09:04

    git checkout {branch-name} -- {file-name}

    This will use the file from the branch of choice.

    I like this because posh-git autocomplete works great with this. It also removes any ambiguity as to which branch is remote and which is local. And --theirs didn't work for me anyways.

提交回复
热议问题