Up until now I worked on my websites alone and without any kind of version control right on my server (basically opened and modified files stored in each /var/www/vhosts/domain.tld/httpdocs-Folder
directly over sftp with an IDE/over ssh) since it was sufficient for my needs.
Now I'm searching for the best way to collaborate with other developers and use git for all of these already existing websites.
Is it recommendable to create multiple bare repositories like
/home/git/domain_1.git, /home/git/domain_2.git, ...
with e.g. git init --bare domain_1.git
in some folder like /home/git/
with my root-Account and then somehow** add each already existing /var/www/vhosts/domain/httpdocs-Folder
to each of these bare git repos and then add an hook (post-receive?) to each repo to overwrite it's specific /var/www/vhosts/domain.tld/httpdocs-Folder
at every push. And then give every developer access via the git-User with URL like ssh://git@1.2.3.4:/home/git/domain_1.git
for each single repo.
If that way should be fine: Is there any kind of walkthrough out there? I couldn't find anything and I'm searching for a proper solution since days, no kidding...
Or is there any better/best practice to solve this kind of issue?
** = (how?! since no git command like git add
works on these bare repos...)