Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Created April 10, 2013 16:56
Show Gist options
  • Save iolloyd/5356431 to your computer and use it in GitHub Desktop.
Save iolloyd/5356431 to your computer and use it in GitHub Desktop.
accepting the remote file version during merge conflicts when rebasing
git pull --rebase origin <yourbranch>
... some merge conflict. Let's say the file is called foo/lika.py
git co --theirs foo/lika.py
git add foo/lika.py
git rebase --continue
That's it
@iolloyd
Copy link
Author

iolloyd commented Apr 10, 2013

co => checkout. to add it in your git shortcuts, just type git config alias.co checkout

@iolloyd
Copy link
Author

iolloyd commented Apr 10, 2013

a more comprehensive shortcut is to add this to your .bashrc, .zshrc or .profile .. alias git-theirs="git co --theirs $1; git add $1; git rebase --continue". usage: git-theirs some/file.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment