Skip to content

Instantly share code, notes, and snippets.

@gabrieljoelc
Last active December 12, 2015 08:08
Show Gist options
  • Save gabrieljoelc/4741341 to your computer and use it in GitHub Desktop.
Save gabrieljoelc/4741341 to your computer and use it in GitHub Desktop.
Git sub-prompt commands in PowerShell to convert all Subversion branches to Git branches after a `git svn clone` was already performed.
& git for-each-ref --format='%(refname)' refs/heads/tags | % {
#Extract the 4th field from every line
$_.Split("/")[3]
} | % {
#Foreach value extracted in the previous loop
& git tag $_ "refs/heads/tags/$_"
& git branch -D "tags/$_"
}
@gabrieljoelc
Copy link
Author

This is incomplete right now. I still can't figure out lines 2 and 6.

@gabrieljoelc
Copy link
Author

@Graimer on StackOverflow gave me the answer in Revision 3: http://stackoverflow.com/a/14780657/34315

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