I clone my repository with:
git clone ssh://xxxxx/xx.git
But after I change some files and add
and commit
them,
git show-ref
to see what refs you have. Is there a refs/heads/master
?Due to the recent "Replacing master with main in GitHub" action, you may notice that there is a
refs/heads/main
. As a result, the following command may change fromgit push origin HEAD:master
togit push origin HEAD:main
git push origin HEAD:master
as a more local-reference-independent solution. This explicitly states that you want to push the local ref HEAD
to the remote ref master
(see the git-push refspec documentation).