Error src refspec master does not match any error failed to push some refs to ssh xxxxx com project git

+1 vote

Hi Team,

I have one got repository in my Windows system. Now I want to push that in the Github repository. But it is showing me the below error.

$ git push origin master
error: src refspec master does not match any.  
error: failed to push some refs to 'ssh://xxxxx.com/project.git'
Dec 22, 2020 in Git & GitHub by akhtar
• 38,230 points
26,832 views

1 answer to this question.

–1 vote

Hi@akhtar,

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 commit your changes.

$ git commit -m "Initial comment"

Now try to push to the GitHub repository.

$ git push origin master

This will surely work.

answered Dec 22, 2020 by MD
• 95,440 points

Related Questions In Git & GitHub

+2 votes
3 answers
+1 vote
1 answer

master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:abc70/new.git'

Hi@akhtar, To update your local repo to GitHub ...READ MORE

answered Feb 14, 2020 in Git & GitHub by MD
• 95,440 points
19,426 views
0 votes
1 answer

git error: failed to push some refs to remote

I would advise using: git pull --rebase git push The ...READ MORE

answered May 2, 2022 in Git & GitHub by narikkadan
• 63,420 points
7,634 views
–1 vote
1 answer
0 votes
1 answer

gerrit-cherry-pick:fatal: 'origin' does not appear to be a git repository

The user account making that command does ...READ MORE

answered Aug 13, 2018 in Git & GitHub by Kalgi
• 52,360 points
1,654 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,503 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP