Skip to content

Instantly share code, notes, and snippets.

@ragar90
Last active July 27, 2016 20:42
Show Gist options
  • Save ragar90/4246129e9fd40778ede8e4cf73c648b0 to your computer and use it in GitHub Desktop.
Save ragar90/4246129e9fd40778ede8e4cf73c648b0 to your computer and use it in GitHub Desktop.
Merge only changes from branch B into current branch A
# After merging master into this branch, let's use the files from master and ignore our conflicts
git checkout --theirs some/file/in/my/repo/with/conflicts
# Now let's add those files into the commit
git add .
# This should result in something like this when running 'git status'
# On branch blah
# Your branch is up-to-date with 'origin/blah'.
# All conflicts fixed but you are still merging.
# (use "git commit" to conclude merge)
# Changes to be committed:
# ...
# Conclude the merge
git commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment