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

It looks like both are doing the same task for me.
Are there cases where they are different?

What's the difference between:
git push origin HEAD


git push origin [current-branch-name]

+3


source to share


1 answer


They mean the same thing,
since HEAD points to the tip of the current branch .
You can see this answer for reference



EDIT
The only time it wouldn't give the same result is
when you are in a detached HEAD ;
but of course, in this case,
what is your definition of [current-branch-name] ?

+6


source







All Articles