Instructions on bare repo for pushing up from existing folder need to tell user to commit
Closed
Instructions on bare repo for pushing up from existing folder need to tell user to commit
Created by: pbx
When you go to the home page of a project with an empty repo, the "Existing folder or Git repository" instructions are:
cd existing_folder
git init
git remote add origin gitlab@gitlab.example.com:repo.git
git push -u origin master
This probably works if you are pushing from an existing Git repo. However, if you execute the above verbatim in an existing folder that is not already a Git repo, the last command fails with:
error: src refspec master does not match any.
error: failed to push some refs to gitlab@gitlab.example.com:repo.git
The missing piece is: if the user is creating a new git repo locally, they need to make a commit before trying to push.
Please register or sign in to reply