Closed MaurGi closed 4 months ago
note: the commit id in the subrepo file is the correct sha of master on the remote subrepo
anyone can help? my question is what is the sequence of commands to be able to pull the changes from subrepo remote master, make local changes, then push to another branch on remote so I can do a PR on the subrepo.
git init .
touch "file1"
git add file1
git commit -m "Add file1"
git subrepo clone git@github.com:youruser/repo lib1
touch lib1/file2
git add lib1/file2
git commit -m "Add file2 to lib1"
git subrepo push -b "file2-in-lib1-branch" lib1
Heads up but you will be in a disconnected state. Because the SHA from the push won't be in the original branch, likely main or master, until your patch has been merged in subrepo will have trouble reconnecting the repos. This is because pushing to another branch doesn't change the branch that the subrepo is following you have to use --update for that. I have been debating, and recently decided to remove the commit that comes from pushing and just let everything sort itself out with the next pull.
I really don't understand how a normal workflow is supposed to work.
Assuming I just cloned it a subrepo in my ci/_lib folder-
I want to: 1 - Pull the latest changes from the subrepo remote master 2 - Make some local changes on top 3 - Push to the subrepo remote, possibly in another branch so I can create a PR on the upstream
I am doing:
without even adding any change, if I try to:
well darn, I just pulled...