1. create repo
$mkdir /dev/repos/proj.git
$cd /dev/repos/proj.git
$git init --bare
2. add existing code to it$cd /dev/repos/proj.git
$git init --bare
$cd /dev/existingdir
$git init
add any directories/files to be ignored to .gitignore in this directory. create .gitignore if it does not exist$git init
$git add *
$git commit -m "message"
$git remote add origin /dev/repos/proj.git
$git remote update
$git push origin master
$git commit -m "message"
$git remote add origin /dev/repos/proj.git
$git remote update
$git push origin master