![]() Worse yet, if there were matching refs that can be fast-forwarded, they would have been published prematurely, even if the user feels that they are not ready yet to be pushed out, which would be a real disaster. When we added a syntax sugar " git push remote -delete" ( man) to " git push" ( man) as a synonym to the canonical git push remote ( man) : syntax at f517f1f (" builtin-push: add ( man) -delete as syntactic sugar for :foo",, Git v1.7.0-rc0 - merge), we weren't careful enough to make sure that is not empty.īlindly rewriting " -delete " to " :" means that an empty string results in refspec " :", which is the syntax to ask for "matching" push that does not delete anything. (Merged by Junio C Hamano - gitster - in commit 1400458, ) push: do not turn -delete '' into a matching push See commit 20e4164 () by Junio C Hamano ( gitster). " git push $there -delete" ( man) should have been diagnosed as an error, but instead turned into a matching push, which has been corrected with Git 2.31 (Q1 2021). ![]() Git push -delete origin $TAGNAME is the correct approach (in addition of a local delete).īut: make sure to use Git 2.31+ (Q1 2021). Which can also be shortened to: git push origin release-1.0:release-1.0īy omitting the source ref (the part before the colon), you push 'nothing' to the destination, deleting the ref on the remote end. Tags work the same way: git push origin refs/tags/release-1.0:refs/tags/release-1.0 Which because of default paths, can be shortened to: git push origin master:master Pushing a branch, tag, or other ref to a remote repository involves specifying "which repo, what source, what destination?" git push remote-repo source-ref:destination-refĪ real world example where you push your master branch to the origin's master branch is: git push origin refs/heads/master:refs/heads/master If you also need to delete the local tag, use: git tag -delete tagname If you want to make sure that you cannot accidentally remove the branch instead of the tag, you can specify full ref which will never delete a branch: git push origin :refs/tags/tagname Note that git has tag namespace and branch namespace so you may use the same name for a branch and for a tag. Or, more expressively, use the -delete option (or -d if your git version is older than 1.8.0): git push -delete origin tagname Please show your love and support by sharing this post.You can push an 'empty' reference to the remote tag name: git push origin :tagname
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |