Skip to content

Instantly share code, notes, and snippets.

@abdumu
Last active February 29, 2020 21:32
Show Gist options
  • Save abdumu/51ae1db462a70a26f771b7314ae9b4a1 to your computer and use it in GitHub Desktop.
Save abdumu/51ae1db462a70a26f771b7314ae9b4a1 to your computer and use it in GitHub Desktop.
Get files from a range of commits from a different branch and merge them into your current branch
# Get files from a range of commits from a different branch
# and merge them into your current branch
#
# Imagine you are in `feature` branch, and you want
# get files [between range of commits] from `master` and merge them
# into `feature` branch.
$ git checkout master -- $(git diff --name-only SHA1 SHA1 --diff-filter=ACMRTUXB)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment