ingydotnet / git-subrepo

MIT License
3.18k stars 263 forks source link

git subrepo commit fallback to previous commits #588

Closed vhp1360 closed 11 months ago

vhp1360 commented 1 year ago

Hello, first of all, let me say thanks for this repo.

I faced a problem. I have repo for example mainrepo and use git subrepo clone URL Global/ inside mainrepo folder. after some chang, I do git add . , git commit , git push in mainrepo folder. all things are Ok. but when I try to git subrepo commit or git subrepo push the code in Global fallback to previous commit. is there any but, or I made a mistake?

thanks.

admorgan commented 1 year ago

git subrepo commit will bring the state of the worktree for the subrepo code into the parent project. So if there is a stale worktree I could see that happening, but git subrepo push does not change the state of the parent project, just updates the .gitrepo to reflect that the upstream and local copies are in sync to reduce the amount of work for the next git subrepo pull. Is this a code base I can view? If not could you create a minimal test that you could send me to investigate? If not could you run with git subrepo push --debug and post the out put here?

vhp1360 commented 1 year ago

thanks for your feedback and sorry for being late. I'm sending debug in these days. thanks again

vhp1360 commented 1 year ago

Hello again. you are right. I can push without any problem if I won't try to git subrepo commit before it.