简体   繁体   中英

GIT push all branches in subdirectory to other repo

We've got a setup with multiple GIT repos and would like to do following with an automated process

repo1/specificbranch
|-branch1
|-branch2
|-branchn

to

repo2/organisation/specificbranch
|-branch1
|-branch2
|-branchn

remotes have been setup, but I've got a hard time figuring out the command to perform.

for repo_dir in repo1/specificbranch repo2/organisation/specificbranch
do
    pushd $repo_dir
    git push origin --all
    popd
done

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM