Page 1 of 1

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

Posted: Fri Nov 04, 2016 2:27 pm
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.