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