5) Git configs : server to server (peer to peer)

First way to use Git for say sync between your local computer and your remote server is to create a full git project on each.
By default, a Git projet is a server.
Yet, as this is not the most frequent architecture (see « Git configs : centralized »), the info to setup such an architecture are pretty scarce on the net.
Here is the recipe.

1) Say you have your git project on your local computer.

2) « git init » on wanted folder on remoter server.
+ config (in ~/.gitconfig for example) :
– receive.denyCurrentBranch = ignore (this is the main caveat !)
– set a post-receive hook to have your WORKTREE updated on every push from your local.

3) Set the server as a remote on your local project :
remote add newserver

4) Push whatever

Ce contenu a été publié dans git, Non classé. Vous pouvez le mettre en favoris avec ce permalien.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *