Skip to content

Instantly share code, notes, and snippets.

@stephenjtong
Last active May 8, 2021 09:29
Show Gist options
  • Save stephenjtong/28f8b6b2e70d37bc059d2192fbca3925 to your computer and use it in GitHub Desktop.
Save stephenjtong/28f8b6b2e70d37bc059d2192fbca3925 to your computer and use it in GitHub Desktop.
git sync repo1 to repo2
for dir in ams-backend ams-frontend ams-pop ams-crm-android qrscan
do
cd /root/git_sync/$dir
sudo git fetch --all
for a in $(git branch -a | grep remotes|grep gerrit | sed 's/remotes\/gerrit\///'); do git push -f origin gerrit/$a:refs/heads/$a; done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment