Git automatic sync branch in real time

Issue

Im a bit new to using git. We have a git repository with a couple of users. Is there a way to automatically sync changes down without having to press sync/do a git pull?

So when someone else does a git push it automatically syncs my instance of it. A bit like how dropbox works?

Solution

Git does not support that kind of feature. The closest thing you could do to mimic this behavior would be to use git-hooks that would when someone of your team pushes, pull all collaborator repository automatically.

This will however be quite complex to setup (especially to update an actual user working directory) and will inevitably lead to issues (when, for example you are working on a some file that another use has juste updated; Git will refuse to pull and you’ll have to perform a merge operation by hand).

SCMs such as Git never update your working copy automatically.

Answered By – Oct

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published