Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Difference between git config push.default and git push origin HEAD

I have read about how we can configure our git push to push to the current branch we are in using
1.

git config push.default current

but I also read about how you can push to your remote branch (to have the same name as your local branch) using
2.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

git push origin HEAD

When do you use 1 and when do you use 2?

>Solution :

If you set git config push.default current, then you can later just do git push. When you do git push origin HEAD, you are explicitly pushing to the HEAD commit to the origin remote.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading