git-subrepo icon indicating copy to clipboard operation
git-subrepo copied to clipboard

How to switch subrepo to another pre-existing branch (equivalent to git checkout)?

Open tdVincentB opened this issue 10 months ago • 1 comments

I can see that the command git subrepo branch can create a new branch, but how do we simply switch to another pre-existing branch (the equivalent to git subrepo checkout)?

This is a simple question and, given its basic need, I guess this is already feasible but it is not clear to me from the README how to achieve it.

By the way, thanks for this great work!

tdVincentB avatar Apr 12 '24 11:04 tdVincentB

To change branches you would pass the -b option. For instance to pull from a different branch you would use git subrepo pull -b new_branch lib/ If you want to push to a different branch you would do the same. Something that has come up before is that pushing does not change the local tracking branch, so be aware of that.

admorgan avatar Apr 12 '24 14:04 admorgan