Skip to content

Instantly share code, notes, and snippets.

@d-kuro
Created October 18, 2018 12:21
Show Gist options
  • Save d-kuro/08ec0964107ae4c8bc074ed8162b63cc to your computer and use it in GitHub Desktop.
Save d-kuro/08ec0964107ae4c8bc074ed8162b63cc to your computer and use it in GitHub Desktop.
コンフリクトしたときの --theirs と --ours

コンフリクトしたときの --theirs と --ours

よく忘れるやつ

merge

$ git checkout branch_b
$ git merge branch_a

# branch_a の内容を一方的に取り込みたい
$ git checkout --theirs [file]

# branch_b の内容を一方的に取り込みたい
$ git checkout --ours [file]

rebase

$ git checkout branch_b
$ git rebase branch_a

# branch_a の内容を一方的に取り込みたい
$ git checkout --ours [file]

# branch_b の内容を一方的に取り込みたい
$ git checkout --theirs [file]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment