leeand00
leeand00

Reputation: 26392

Is a colon-prefixed branch name some kind of alias for git push <remote-name> --delete <remote-branch-name>?

Is running a command like $ git push origin :remote-branch a shortcut for git push <remote-name> --delete <remote-branch-name>

Upvotes: 0

Views: 1314

Answers (1)

padawin
padawin

Reputation: 4476

Yes. From man git-push:

The format is git push <repository> <refspec>, with <refspec> described as follow:

<refspec>
       Specify what destination ref to update with what source object. 
       The format of a <refspec> parameter is an optional plus +, followed
       by the source object <src>, followed by a colon :, followed by
       the destination ref <dst>.

Then:

Pushing an empty <src> allows you to delete the <dst> ref from the remote repository.

Upvotes: 3

Related Questions