Quick git remote setup

After working on a project for some time, the project is way bigger, and it is necessary to backup the git client on a remote server ?

On the remote server: (e.g. after ssh foo@bar.baz…)

mkdi -p project/git
cd git
git init --bare

In the local git tree

git remote add barbaz foo@bar.baz:~/project/git
git push --all barbaz

Done !

Now, to have another copy on the remote server, for example, if the project is a web server, and you what to run the binary, etc:

mkdir project/prod
cd project/prod
git clone ../git/ .
# make, whatever

After changes on the local copy: (from local dir)

git push barbaz

Update the prod tree on the server:

gut pull origin
# again: make...

Fruit Jam » « Android toggle "stay awake"