Git alias to delete remote branch

前端 未结 2 1179
南方客
南方客 2021-02-15 15:55

I am trying to make an alias to delete a remote branch but I can\'t seem to get it, here is my latest attempt that I really expected to work but no luck.

rmrb =          


        
相关标签:
2条回答
  • 2021-02-15 16:29

    Maybe a shell function would be easier?

    [alias]
        rmrb = "!f() { git push origin :$1; }; f"
    

    Or you can use sh:

    [alias]
       rmrb = !sh -c 'git push origin :$1' -
    
    0 讨论(0)
  • 2021-02-15 16:35

    You just have to define it like this:

    [alias]
        rmrb = "push --delete origin"
    

    And do git rmrb mybranch

    0 讨论(0)
提交回复
热议问题