Git init: error "src refspec master does not match any"

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....

Git init: error "src refspec master does not match any"

Postby peter_b » Fri Nov 04, 2016 2:27 pm

[PROBLEM]
Setting up my first Git repository, according to instructions in "Setting up the Server" (git.scm.com).

Executing the following command:
Code: Select all
$ git push origin master

Was followed by this error message:
error: src refspec master does not match any.


Quite cryptic.

[SOLUTION]
The problem was that the folder on the client was empty.
Simply create any file, do a "git add" on it, then commit - and then try pushing it again.

Thanks to Mark Longair (on Stackoverflow), solving it was simple.
  • 0

User avatar
peter_b
Chatterbox
 
Posts: 307
Joined: Tue Nov 12, 2013 2:05 am
Reputation: 3

Return to Knowledge Base

Who is online

Users browsing this forum: No registered users and 3 guests

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: Bing [Bot] and 24 guests

cron
Reputation System ©'