Message src refspec master does not match any when pushing commits in Git

0 votes

I cloned my repository with:

git clone ssh://xxxxx/xx.git 

I want to push them to the server:

git add xxx.php
git commit -m "TEST"
git push origin master

I get this error:

error: src refspec master does not match any.  
error: failed to push some refs to 'ssh://xxxxx.com/project.git'

Can someone help me with this?

Apr 29, 2022 in Other DevOps Questions by Kichu
• 19,040 points
1,156 views

1 answer to this question.

0 votes

Solution.

  1. Try git show-ref to see what refs you have. Is there a refs/heads/master?
  2. Try git push origin HEAD:master as a more local-reference-independent solution.

For more info:  git-push refspec.

I hope this helps. 

answered Apr 30, 2022 by narikkadan
• 63,600 points

Related Questions In Other DevOps Questions

0 votes
1 answer

How to stop sqlplus command in unix shell script when any sql fails

One idea would be to launch the ...READ MORE

answered Jul 16, 2018 in Other DevOps Questions by Kalgi
• 52,350 points
5,223 views
0 votes
0 answers
+1 vote
2 answers

When do we use Chef or Azure SDK to create VM and deploy in automation

The solution to the automated deployment in ...READ MORE

answered Aug 21, 2018 in Other DevOps Questions by Priyaj
• 58,020 points
1,176 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
4,062 views
0 votes
1 answer

How to checkout Hadoop 2.6.0 from git

Clone the following Git repository: git clone git ...READ MORE

answered Apr 23, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
969 views
0 votes
1 answer

Git: Receiving "fatal: Not a git repository" when attempting to remote add a Git repo

Just init a local Git repository, into ...READ MORE

answered Apr 30, 2022 in Other DevOps Questions by narikkadan
• 63,600 points
1,230 views
0 votes
1 answer

'git' is not recognized as an internal or external command

Add the following paths to PATH: C:\Program Files\Git\bin\ C:\Program ...READ MORE

answered Apr 29, 2022 in Other DevOps Questions by narikkadan
• 63,600 points
5,540 views
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