Define a repo somewhere in your file system with a bare init
1mkdir -p /somewhere/repo/test_project
2cd /somewhere/repo/test_project
3git init --bare
Now create a local folder for your work with init only
1mkdir -p /somewhereelse/work/test_project
2cd /somewhereelse/work/test_project
3git init
Attach your working folder to the repo
1git remote add origin file:///somewhere/repo/test_project
Create your files and commit it
1echo "#first commit" > README.md
2git add README.md
3git commit
Now push to origin and set upstream
1git push --set-upstream origin master
The end.