Created
September 10, 2019 11:50
-
-
Save williamdes/c76d3bbf0b35c1d058c69ad63772ac72 to your computer and use it in GitHub Desktop.
Import git branch as a tag from existing branch with same name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# git: Having a branch/tag with the same name (error: dst refspec matches more than one.) | |
# run git branch --all and use a text editor to create a batch of commands | |
git tag -m "[imported from branch]" --force --sign "release/2019-09-10-1" $(git show-ref --hash "refs/remotes/origin/release/2019-09-10-1") | |
# https://markhneedham.com/blog/2013/06/13/git-having-a-branchtag-with-the-same-name-error-dst-refspec-matches-more-than-one/ | |
# Delete ref from remote | |
git push origin :"refs/heads/release/2019-09-10-1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment