Alexander Suraphel
Alexander Suraphel

Reputation: 10633

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

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]

Upvotes: 11

Views: 11335

Answers (1)

Chris Maes
Chris Maes

Reputation: 37842

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]?

Upvotes: 13

Related Questions