Quick and Dirty Git Repository
December 29, 2008
Do you have an app you want to keep in version control, put you don’t want to put it on Github? Well, you can obviously use git to keep track of your versions, but do you want some way to back it up? Do you have a server you plan to deploy the app to already setup with SSH keys and everything? Assuming you already have git installed on both your machine and the remote machine, here’s all you need to do:
Create The Remote Git Repo
$ ssh email@example.com $ mkdir yourproject.git $ cd yourproject.git $ git --bare init
Create The Local Git Repo, If You Haven’t Already
$ git init $ git add . $ git commit -a "Initial Checkin"
Add The Remote Repo
$ git remote add origin firstname.lastname@example.org:yourproject.git
Push To the Remote Repo
$ git push origin master
Now you have a full copy of the repo locally and on the server.