#Try 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
#from ---> git push origin HEAD:master
#to ---> git push origin HEAD:main
#You can try
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).
# You are trying to add an empty repository, add something first, like a readme
touch README.md
git add README.md
git commit -m "Initial commit"
git push --set-upstream origin master
git show-ref
git commit -m "initial commit"
git push origin master
Try 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 from git push origin HEAD:master
to git push origin HEAD:main
So try `git push origin main`
# find the right branch: master or main
# newer git repos start with main
git push origin main
# to switch head branch:
git branch -M main
mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .
git commit -m "initial commit"
git push origin master
Check master vs main
Code Example |
---|
Shell :: TTTTTTTT |
Shell :: npm install line awesome |
Shell :: uninstall vscode completely windows 10 |
Shell :: git change origin url |
Shell :: linux get date yyyymmdd |
Shell :: awk count if |
Shell :: kali |
Shell :: validate ssl certificate on website using curl |
Shell :: update fc editor |
Shell :: create zip file ubuntu |
Shell :: aws ec2 swap |
Shell :: laravel generate random 6 digit number |
Shell :: git set alias |
Shell :: print unique lines |
Shell :: gpg change password |
Shell :: remove trash linux |
Shell :: docker clean logs |
Shell :: youtube dl download playlist by index |
Shell :: double dollar sign bash |
Shell :: bun.sh install |
Shell :: react native init |
Shell :: how to install protractor |
Shell :: git tag last |
Shell :: wslinux import |
Shell :: how to install gitkraken on fedora |
Shell :: linux virtual audio cable |
Shell :: create gitignore |
Shell :: how to do change permissions partition in linux |
Shell :: git push heroku master |
Shell :: git global setup |