Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating local branches with Repo

Tags:

git

repo

We've started using Repo (described here: https://source.android.com/source/developing.html) to manage our set of git repositories. After doing init and sync, all the repositories have detached HEADs.

When the manifest version of a repository is a branch, I would like to automatically create a local branch tracking the remote one, for all git repositories in the manifest. Is that possible?

like image 900
anr78 Avatar asked Oct 28 '25 06:10

anr78


1 Answers

yes use the repo forall command. Look at repo help forall for more information.

for more info see https://source.android.com/source/using-repo.html#forall

If you want to specify the manifest revisions exactly (these will generally be the branch names specified in the manifest) but manifests can contain SHAs as well.

repo forall -c 'git branch new_branch $REPO_RREV'
like image 80
Lee Ballard Avatar answered Oct 29 '25 21:10

Lee Ballard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!