Given you've set up a git daemon on <url> and an empty repository:
I.cd <localdir>
II.git init
III.git add .
IV.git commit -m 'message'
V.git remote add origin <url>
VI.git pull <url> master
VII.git push -u origin master
After the step VI, you may meet of problem of "merge branch....", the solution is :
5. Common problem
Q1: ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/gll89/AD_MCI_NC_classifier.git'
A1 :In this case the only change was the readme file created as optional step when creating github repository.
git pull https://github.com/*username*/*repository*.git masterfrom: https://stackoverflow.com/questions/11696295/rejected-master-master-non-fast-forward