Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

error: src refspec master does not match any

#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).
Comment

error: src refspec master does not match any. git

# 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
Comment

error: src refspec main does not match any. error: failed to push some refs to

git show-ref
Comment

error: src refspec master does not match any error: failed to push some refs to android studio

git commit -m "initial commit"
git push origin master
Comment

error: src refspec master does not match any

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`
Comment

error: src refspec master does not match any

# 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
Comment

error: src refspec main does not match any error: failed to push some refs to

mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .

git commit -m "initial commit"
git push origin master
Comment

error: src refspec main does not match any error: failed to push some refs to

Check master vs main
Comment

PREVIOUS NEXT
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 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =