Git merge while discarding any previous changes(In local repository or from the last commit)

后端 未结 3 1638
闹比i
闹比i 2021-01-23 11:43

In Git, during a merge, is there a way that we can tell git to discard local changes in case of a conflict and apply the changes from the merged branch?

I mean if there

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-23 12:24

    It sounds like you want to read about the merge strategies 'theirs' and 'ours'. When merging you can specify that either your current branch (ours) or the remote branch (theirs) is the correct one.

提交回复
热议问题