I got an error when executing the "git subrepo push
What is the correct command to execute to finalize the rebase and then finally to push the changes?
Hi @danielbsig,
It looks like you now need to checkout your starting branch (usually master)
and then execute: git subrepo push <subfolder> subrepo/<subfolder>.
Basically, you needed to go into the branch that was created for you, fix the
errors, and then get back out. You can't do subrepo commands from the
perspective of the parent repo with the subrepo checked out.
We should probably detect this situation and be more helpful. I'll admit it's
a bit confusing at first.
If you can, please provide a URL to a gist of the instructions you were given
by `the commands in question. It could help us refine the messaging.
If I try to issue the following commands:
git checkout <main branch>
git subrepo push <subfolder> subrepo/<subfolder>
I get the following message:
git -subrepo: 'subrepo/<subfolder>' is not a valid commit
What got me to this place was basically the following steps (my
git subrepo push app/Common
git-subrepo: Command failed: 'git rebase --onto be83f698ddd811f21a9f8c0f63d32ea2 210d5062 8274bcba6f1f38fa753c02a6d4dcb9067e55f353 subrepo-push/app/Common'.
At this point, it would have been helpful to get some messages, indicating what was really the issue and what I should do to resolve them.
I then went through fixing merge conflicts and issuing git rebase --continue as needed, until the merge conflicts were gone. At that point I issued git status with the following result:
git status
On branch subrepo-push/app/Common
Finally, just to clarify: I very much appreciate the work that has been put into this module. It seems to be a much better solution than git submodules.
@danielbsig What version of subrepo are you using?
If you are using master (0.3.1) there are some known issues that we try to resolve, so you might want to try out release/0.4.0 branch.
$ git subrepo version
git-subrepo Version: 0.3.1
Copyright 2013-2017 Ingy d枚t Net
https://github.com/git-commands/git-subrepo
C:\Code\subrepo\git-subrepo\lib\git-subrepo
Git Version: git version 2.14.3.windows.1
If I want to use 0.4.0, would be enough to switch to that branch in the folder where I checked out the git-subrepo project?
... to answer my own question: yes that seems to be enough. At least I get a different message when I try to push:
$ git subrepo push app/Common subrepo/app/Common
git-subrepo: No subrepo branch 'subrepo/app/Common' to push.
After some trial and error, I managed to finally push my changes. What I needed to do was the following:
git pull subrepo/app/Common master which resulted in a merge conflict which I had to resolve (again!)git subrepo push app/Common subrepo-push/app/Common, and that seemed to do the trick.In retrospect, the only place where I think better error messages were needed is when the push fails, i.e. when I issued git subrepo push app/Common initially. It would be helpful to direct the user towards what to do. The fact that I'm not experienced "rebaser" might have something to do with it, since I've mostly used good old merge.
@danielbsig thanks for the info. I'm going to re-open this so that we remember to do more work on it.
Great, let me know if I can be of any assistance whatsoever.
Most helpful comment
... to answer my own question: yes that seems to be enough. At least I get a different message when I try to push:
After some trial and error, I managed to finally push my changes. What I needed to do was the following:
git pull subrepo/app/Common masterwhich resulted in a merge conflict which I had to resolve (again!)git subrepo push app/Common subrepo-push/app/Common, and that seemed to do the trick.In retrospect, the only place where I think better error messages were needed is when the push fails, i.e. when I issued
git subrepo push app/Commoninitially. It would be helpful to direct the user towards what to do. The fact that I'm not experienced "rebaser" might have something to do with it, since I've mostly used good old merge.