Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: src refspec master does not match any

I have tried to follow the solutions suggested in this post but it didnt work and I am still getting: src refspec master does not match any.

Here is what I did: Followed this solution

// adding the file I created $ git add . $ git commit -m 'initial commit' $ git push origin master error: src refspec master does not match any. 

When doing:

$ git push origin HEAD:master b40ffdf..a0d1423  HEAD -> master // looks promising  // adding a remote $ git remote add devstage -f <another git> $ git merge devstage/master -s recursive -X ours $ git push -u devstage master error: src refspec master does not match any. 

More information:

$ git branch  * origin  $ git show-ref refs/heads/origin refs/remotes/devstage/master refs/remotes/origin/HEAD refs/remotes/origin/devstage refs/remotes/origin/master refs/remotes/origin/origin 

So I am definitely missing refs/heads/master but dont know how to create it.

Thanks

like image 962
special0ne Avatar asked Jan 21 '14 17:01

special0ne


People also ask

How do you fix SRC Refspec main does not match any?

The solution to this error is to either create a local and remote master branch that you can push the commit to or to push the commit to an existing branch – maybe main . These commands will create a master branch locally. And by pushing to origin master , the master branch will also be created remotely.

What does error SRC Refspec master does not match any mean?

The “src refspec master does not match any” error occurs if you have forgotten to add the files you have changed to a commit and try to push those changes to a remote repository before you make the first commit in your repository.

How do I fix error SRC Refspec main does not match any error failed to push some refs to?

The most probable reason for this error is that all the files are untracked and have not been added. git add --all in case you wish to add all the files Or you can selectively add files. Then git commit -m "Initial comment" , git push origin master . This will surely work.

How do you push origin master?

Whenever we need to push the changes to a remote repository, we use git push along with the remote repository “origin” and “master” branches. The term used is “git push origin master“. To pull the changes from the remote repository to local, we use git pull along with remote repository “origin” and “master” branch.


1 Answers

This should help you

git init git add . git commit -m 'Initial Commit' git push -u origin master 
like image 89
nithinreddy Avatar answered Sep 21 '22 15:09

nithinreddy