We have a two developer team and want use git.
But I don’t know which way to use git is better:
-
Model with bare-repo. Here there are two local repos + one bare (main) repo throught with 2 developers are sync their commits.
-
Model without bare-repo. Here is two local repos, one of which is set as a remote to other.
I wonder what model is better to use and why? And especially what kind of difficulties can be while I would like to use second model.
You generally don’t push into people’s repositories in which they work, that would be troublesome. Bare repositories are for pushing into, while non-bare repos tend to have a developer in front of them and he’s responsible for managing it and pulling into it from places.
So: A model without central repository would contain two non-bare repos (each having the other as remote; consider the remote list as a repository’s “address book”).
During work, you would periodically pull changes from each other, but that would make some problems:
A bare, central repository helps with that: