Maybe I just misunderstood the way subrepo is supposed to work, but I did some changes in my subrepo, commit them, but when I try to subrepo push, I get
git subrepo push client -vd
>>> git rev-parse --verify HEAD
* Assert that working copy is clean: .../webrtc
* Check for worktree with branch subrepo/client
* Fetch the upstream: [email protected]:...client.git (master).
>>> git fetch --no-tags --quiet [email protected]:...client.git master
* Get the upstream subrepo HEAD commit.
>>> git rev-parse FETCH_HEAD^0
* Create ref 'refs/subrepo/client/fetch'.
>>> git update-ref refs/subrepo/client/fetch 30e10c3f76cf60bf5402bab4bcb7ba0e9ca9f83d
* Check upstream head against .gitrepo commit.
* Deleting old 'subrepo/client' branch.
* Remove worktree:
>>> git branch -D subrepo/client
* Create subrepo branch 'subrepo/client'.
* Check if the 'subrepo/client' branch already exists.
* Make sure that 'subrepo/client' exists.
* Check if we have something to push
Subrepo 'client' has no new commits to push.
But the files in my client subrepo are differents from the files currently on the client remote repository, which is troublesome. Did I do something the wrong way?
Hi @Sharcoux,
From you description I can't find anything obvious error. The supplied log doesn't really say anything about the cause either.
One common mistake is that you didn't actually change any files in the subrepo :-) If you want to you can use the git subrepo branch client command to create the intermediate step to see what git-subrepo considers to be you current local state.
If you want you can always verify the subrepo functionality be creating some local test repos and include one of them into the other.
Oh ! I solved it by doing git subrepo clean. I don't understand exactly why and when I am supposed to run this command. I thought it was just to have a clearer history...
@Sharcoux, glad to hear that! Clean will actually remove all local extras created during the git-subrepo operations. So it might be useful to perform that sometimes.
Please let me know if you have any other problems or questions!
You're the best, man.
Actually, I found the solution thanks to the log I received when performing git subrepo branch client as you suggested.
Most helpful comment
You're the best, man.
Actually, I found the solution thanks to the log I received when performing
git subrepo branch clientas you suggested.