If you do not want to use a dedicated server there is always the possibility of using one of the developers' local repository as the "origin" that every other developer clones.
This can easily be done with SSH:
- Set up an SSH server on the origin machine.
- Give every developer SSH access to the machine (either using individual accounts, or a shared account, e.g. "developer").
- Have each developer clone the repository from that machine.
Cloning via SSH can be done like this:
git clone my-account@origin-machine:/full/path/to/repo/.git
...where my-account is the user account, and origin-machine is the machine that holds the origin repository.
Now, each developer can fetch and push changes, thus synchronizing with each other via the origin machine.
In a similar manner you can synchronize with several different machines if you so wish, by setting up more SSH remotes, e.g:
git remote add machine2 my-account@machine2:/some/other/path/to/repo/.git
git fetch machine2
...
git push machine2 my-new-branch
...etc.
However, there is a catch: By default you may not push changes to the branch that is currently checked out on the remote machine (git will warn you if you try to do so, and quite frankly you do not want to do it anyway). Hence, you will have to come up with a branching strategy that avoids such situations (e.g. having all developers work on separate feature branches rather than a common branch is a good start).
With that said, I would strongly recommend using a local dedicated server with a bare repository (it is typically always online, and you do not have the problems with checked out branches on the developer machine). The server does not have to be fancy - something as simple as a Raspberry Pi should suffice in a small team (there is a simple tutorial here).