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 master does not match any.

git init
git add .
git commit -m "first commit"
git branch -M main
git remote add origin "_git repository link here_"
git push -u origin main
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 main does not match any

git merge --allow-unrelated-histories origin/main
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.

git config --global user.email "you@example.com"

git config --global user.name "Your Name"
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 master does not match any.

git push origin main
Comment

error: src refspec master does not match any.

git init
git add . //to add everything
git commit -m ''
git remote -v
git push heroku master
Comment

error: src refspec develop does not match any

git push -u -f origin HEAD:develop
Comment

error: src refspec working does not match any

git push origin HEAD:<remoteBranch> 
Comment

error: src refspec main does not match any

"main" is the usual branch name in Github repos. In some repos, it can be master or some other name
use the following command at that time
git push origin master 
Comment

PREVIOUS NEXT
Code Example
Shell :: get current working directory powershell 
Shell :: uninstall netbeans ubuntu 20.04 
Shell :: git global ignore 
Shell :: Error: GPG check FAILED fedora mysql 
Shell :: docker switch to linux containers command line 
Shell :: last 2 git log entries 
Shell :: how to remove all commit in git 
Shell :: cmake openssl linux 
Shell :: yarn list global packages 
Shell :: scikit learn pip 
Shell :: linux command how much ram 
Shell :: git revert pull from another branch 
Shell :: docker how to run command in mysql 
Shell :: laravel 9 install composer 
Shell :: display id all image docker 
Shell :: mongodb log directory missing ubuntu 
Shell :: pyinstaller icon image 
Shell :: artisan migration rollback 
Shell :: remove env file from git 
Shell :: install babel command line 
Shell :: show the list of file of a commit 
Shell :: subl command not found 
Shell :: nuget install location 
Shell :: install lamp ubunto 
Shell :: git ignore still tracking 
Shell :: test smb connection linux 
Shell :: error install cocoapods 
Shell :: zsh: command not found: nslookup 
Shell :: powershell download a file from url 
Shell :: pscp ubuntu copy folder recursively 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =