Reputation: 19969
I have a branch that I did a bunch of Rubocop changes to (called dev/rubocop-changes). I'd like to create a branch (called dev/rubocop-changes-no-app) that takes all the changes from this with the exception of changes in the /app directory (ie /spec, / etc....).
How would I do this?
Upvotes: 1
Views: 42
Reputation: 22017
This would be a way to do it :
1) Creating the new branch from your main trunk (let's assume dev here for the example)
git checkout dev
git checkout -b dev/rubocop-changes-no-app
2) Taking all your changes from the Rubocop branch (but preventing the merge from finishing)
git merge --no-commit dev/rubocop-changes
3) Rewinding the /app directory back to the state it was before the merge
git checkout dev -- /app/*
4) Then finishing the merge commit
git commit -am "merge commit message here"
Upvotes: 3