Created
May 10, 2012 10:15
-
-
Save manuelmorales/2652291 to your computer and use it in GitHub Desktop.
How to merge just one file from a another branch with Git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Lets suppose that we want to merge path/to/my/file.txt from branch_a into branch_b | |
# We start in branch_b | |
git checkout branch_b | |
# We create an intermediate branch | |
git checkout -b intermediate_branch | |
# We merge merge_a into that | |
git merge branch_a | |
# We go back to branch_b and get the merged file | |
git checkout branch_b | |
git checkout intermediate_branch path/to/my/file.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment