11

It looks like both accomplish the same task to me.
Are there cases in which they are different?

What is the difference between:
git push origin HEAD
git push origin [current-branch-name]

Alexander Suraphel
  • 9,083
  • 9
  • 48
  • 86

1 Answers1

12

They mean exactly the same, since HEAD points to the tip of the current branch. See this answer for reference.

EDIT:

The only case in which this would not give the same result is when you are in detached HEAD state; but in that case, what is your definition of [current-branch-name]?

binaryfunt
  • 5,618
  • 5
  • 33
  • 54
Chris Maes
  • 30,644
  • 6
  • 98
  • 124