how to set up a git repository locally

Shell
cd /path/to/my/codebase
git init   
git add .    
git commit -m "my comment" # New local repository
git init
git add .
git commit -m "Initial commit"

# New remote repository
git remote add origin [email protected]:username/new_repo #ssh
# Now push
git push -u origin mastergit init
git add somefile
git commit -m "initial commit"
git remote add origin https://github.com/username/new_repo
git push -u origin master git code to create new remote repo
Source

Also in Shell: