Answered by : sakar-hamasaeed
#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).
Source : https://stackoverflow.com/questions/4181861/message-src-refspec-master-does-not-match-any-when-pushing-commits-in-git | Last Update : Wed, 23 Nov 22
Answered by : frightened-falcon-zzkpm93acx8d
# Git commands one can use to push the local repository to github repo
git init
git add .
git commit -m "First Commit"
git remote add origin url_to_repo
git push origin main
# If you get error such as below
# error: src refspec main does not match any
# error: failed to push some refs to 'Repo url'
# Then use below command to push the code.
git push origin HEAD:main
Source : | Last Update : Sun, 22 Oct 23
Answered by : mushy-moose-ad9oqyimrduq
mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .
/*Make sure you commit before push to github*/
git commit -m "initial commit"
git push origin master
Source : https://itsmycode.com/git-error-src-refspec-master-does-not-match-any/ | Last Update : Sat, 02 Apr 22
Answered by : grieving-gharial-54afdxs4rdwl
mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .
git commit -m "initial commit"
git push origin master
Source : https://stackoverflow.com/questions/4181861/message-src-refspec-master-does-not-match-any-when-pushing-commits-in-git | Last Update : Sat, 14 Aug 21
Answered by : ashwin-selvakumar
git push heroku HEAD:master
Source : | Last Update : Fri, 22 Jan 21
Answered by : abdellatif-anaflous
You probably forgot to add your your changes to staging area.
So type :
git add .
then :
git commit -m "meesage"
finally :
git push origin branch_name
Source : | Last Update : Sun, 24 Apr 22
Answered by : motionless-mantis-q6orzk20plca
error: src refspec master does not match any.
error: failed to push some refs to 'ssh://xxxxx.com/project.git'
Source : https://stackoverflow.com/questions/4181861/message-src-refspec-master-does-not-match-any-when-pushing-commits-in-git | Last Update : Mon, 04 Jan 21