git - Setting up a remote repo for of a local repo
After creating a new local repository either brand new or cloning an existing repo typically I want to push it to my server for backup purposes. To do so I create a bare repository on the server:
mkdir <path-to-repo>/<name-of-repo.git> cd <path-to-repo>/<name-of-repo.git> git --bare init --shared
The repo is now created go back to the local repo and have the local master branch track the remote origin and push it to the remote which we’ve named ‘origin’:
cd <path-to-local-repo> git remote add -t master origin git://<server>/<name-of-remote.git> git push origin master