-
-
Save dylan-k/6770909 to your computer and use it in GitHub Desktop.
This is one way to work with a subset of files, within a Git Branch. See also: http://ask.metafilter.com/249100/Can-a-Git-Branch-Contain-Only-a-Sub-Set-of-the-Repository#3617407
This file contains 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
# (on master) | |
git checkout -b subset | |
git rm file1.txt file2.txt # (remove the files you don't want on this branch) | |
git commit -m 'removed some stuff' | |
git checkout master # (go back to master) | |
git merge --strategy ours subset # (record a merge from the subset branch, but make no actual changes to master) | |
git checkout subset | |
# (edit file3.txt) | |
git add file3.txt | |
git commit -m 'edited file3' | |
git checkout master # (back to master again) | |
git merge subset # (will merge the change to file3.txt but still not the deletions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment