0

what is the difference between :

git push origin HEAD: <name-of-remote-branch> 
git push origin CURRENT_BRANCH_NAME

Is CURRENT_BRANCH_NAME the name of my local branch or the remote branch ?

user3443063
  • 1,455
  • 4
  • 23
  • 37

1 Answers1

0

From git help push:

The format of a <refspec> ... [is] the source object <src>, followed by a colon :, followed by the destination ref <dst>.

Then:

missing :<dst> means to update the same ref as the <src>

i.e. git will interpret git push origin CURRENT_BRANCH_NAME as git push origin CURRENT_BRANCH_NAME:CURRENT_BRANCH_NAME, assuming your git config is relatively standard.

Kache
  • 15,647
  • 12
  • 51
  • 79