Reputation: 4419
I'm working on dividing part of my main repository into another one. I'm using git subtree to do the work.
So I created a subtree branch with the following command:
git checkout master
git subtree split -P ./Foo -b subtreeBranch
A new branch is created with the content of Foo, named as subtreeBranch
.
But later some changes have been added into the original branch(master
), onto the files inside Foo
.
How can I update the subtreeBranch
with the new commits?
Upvotes: 4
Views: 1540
Reputation: 4419
I managed to fix i by running git subtree split
again on the original branch. As stated in the git subtree reference regarding split:
Repeated splits of exactly the same history are guaranteed to be identical (i.e. to produce the same commit ids). Because of this, if you add new commits and then re-split, the new commits will be attached as commits on top of the history you generated last time, so 'git merge' and friends will work as expected.
However running git subtree is a very slow process, probably related to the size of my project.
Upvotes: 4
Reputation: 265231
Use the subtree merging strategy:
git merge -s subtree branch_to_merge
Upvotes: 1