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
  • 10,103
  • 10
  • 55
  • 90

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
  • 6,401
  • 5
  • 37
  • 59
Chris Maes
  • 35,025
  • 12
  • 111
  • 136