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....
Post Reply
User avatar
peter_b
Chatterbox
Posts: 370
Joined: Tue Nov 12, 2013 2:05 am

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

Post by peter_b »

[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.
Post Reply