Skip to content

Instantly share code, notes, and snippets.

@arielallon
Created July 29, 2015 15:22
Show Gist options
  • Save arielallon/e3a7a960f5e19c87763d to your computer and use it in GitHub Desktop.
Save arielallon/e3a7a960f5e19c87763d to your computer and use it in GitHub Desktop.
Migrate branches and tags to git from svn when using Atlassian's scripts
for branch in `git branch -r | grep "origin/[^tags|master|trunk]" | sed 's/ origin\///'`; do
git branch $branch remotes/origin/$branch
done
for tag in `git branch -r | grep "origin/tags/" | sed 's/ origin\/tags\///'`; do
git tag $tag remotes/origin/tags/$tag
done
@arielallon
Copy link
Author

Courtesy of http://stackoverflow.com/a/25994440/1200542

The svn-migration-scripts.jar clean-git command seems to fail creating the remote branches locally so they can be pushed in the migration.
The above achieves what was intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment