Balamurugan A
Balamurugan A

Reputation: 1974

How to run git command to specific projects

I want to run a git command only to specific repositories. I know 'repo forall' will help to run a command to all the git projects in that repo. But, I want to run on specific projects.

For an example.

repo forall -c "git checkout -t remotes/origin/TESTBRANCH" 

Will run the git command to checkout to TESTBRANCH for all projects.

But I want to checkout only few projects, 1. kernel 2. frameworks/av 3. hardware/qcom/media.

Tried as below,

repo forall -c "git checkout -t remotes/origin/TESTBRANCH" kernel frameworks/av hardware/qcom/media`

But, not working. Can anyone help?

Upvotes: 0

Views: 156

Answers (1)

Magnus Bäck
Magnus Bäck

Reputation: 11581

As indicated by the documentation (repo help forall), the project names should go before the -c option:

repo forall kernel frameworks/av hardware/qcom/media \
  -c "git checkout -t remotes/origin/TESTBRANCH"

Upvotes: 1

Related Questions