Skip to content

Instantly share code, notes, and snippets.

@iluwatar
Created February 21, 2015 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iluwatar/276aa970f5cdea2e9fd9 to your computer and use it in GitHub Desktop.
Save iluwatar/276aa970f5cdea2e9fd9 to your computer and use it in GitHub Desktop.
git_merge_tags
cd <work dir>/<dst repository>
git remote add -f <src repository1> <work dir>/<src repository1>
git fetch -t <src repository1>
git checkout -b <tag> tags/<tag>
git merge --no-edit tags/<tag>
git remote rm <src repository1>
git remote add -f <src repository2> <work dir>/<src repository2>
git fetch -t <src repository2>
git merge --no-edit tags/<tag>
git remote rm <src repository2>
# ... repeat for src repositories 3-5 ...
# ... finally create tag from the merged branches ...
git tag -a <tag> -m "Merged tag."
git push origin tags/<tag>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment