New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to push to a new subrepo which has some initial commits #145
Comments
Do I understand this correctly in that you first perform Current solution will try to find a common ancestor and as stated in the error message it can't be found, why? Because it can't find commits with equal tree hash between the two repos. Think of it as trying to merge two separate branches with no common ancestors. One way to solve this would be:
Example:
|
thanks. I'm learning fast, I hope :)
And then pull the result into a new repo. This takes minutes (for small number of commits out of the 30,000 total) rather than an hour with subrepo and 6 hours with subtree. After I've extracted all my subdir from the bigrepo I can pull them all into a new project repo with subrepo to reconstitute the original bigrepo. With all the commits squashed I believe it will run much quicker. This completely avoids the common ancestor issue. Do you see any issues with that this strategy? |
Looks good to me. One question though, I was under the impression that you had an existing repo that you wanted to use for your subrepo? |
Just a few standard files. When I pull the subdir into the 'new' repo it warns there are no common commits. I also get progress reported by filter-branch. And one of my subdir would not subtree push to an empty repo. Thanks for your help. Suggestion for the wiki - when pushing and no common ancestor is reported, if its really OK, just pull the subdir branch into the new repo. |
How do you push to a new subrepo which has some initial commits?
The
subrepo init
works.The
subrepo push
orsubrepo pull
both fail with this:Documentation states that the remote branch must be "properly merged".
I have performed a
git pull
into the parent project and that made no difference.The text was updated successfully, but these errors were encountered: