-1

We have a scenario in which single server is running, which is getting data from the network span.

Every developer should work on their machine locally but the data to work on is only available in the server. how can I get the data to be replicated into each developers machine so that once they have completed development on their local machine, developers can push it to a GIT in the server.

PS: The network span data is constantly written to the server (data is in size of 100s of GB's).

What we have tried so far:

So we created a GIT server in the server we were getting the data on. But once a developer log in using his username then he creates a new branch in a directory. This works fine until another developer logs into the server with his username and switches to another branch in the same directory which will cause all the developers branch to the new one. which is not what we were expecting.

Ashrf Ali
  • 3
  • 3
  • `git pull`? I am not sure I understand the problem. git already has all the tools to pull and push with a remote repository, including branches. Don't let people work on the server, that's not how you use git. Everybody works locally and pulls / pushes. – Robert Mar 29 '22 at 14:30
  • Yes, thats what we are planning to do as well. but the problem is that, we are only getting data on the server not on the local machines. so is there the developers can access the data from the server so they can work locally? – Ashrf Ali Mar 30 '22 at 06:12

1 Answers1

0

Probabily this question should go to https://serverfault.com/, but, anyway...

The git advantage is to have local and remotre repositories, so, in the server, you should have "only" the remote repositories, and they should be cloned in localmachines.

to work with that paradigm, or with the one you are asking for, you need a umask of 007 (depending on your distribution edit /etc/login.defs and change there)

You should have diferent groups for the diferent kind of shared projects, and a user to "own all the repositories", for example, git-adm ).

With all the prerequisites, you create with that user the base folder for all the repositories:

sudo -i
mkdir /srv/git
chown git-adm:gitgrp /srv/git
chmod g+s /srv/git
exit

The last line in the "sticky bite", wich allows to mantain the group (and avoid the problems you previously stated), so, in order to cerate a repository should be something like:

sudo su - git-adm
mkdir /srv/git/<group>/<repoName>.git
cd /srv/git/<group>/<repoName>.git
git init --bare

exit

And thats all: if the folder /srv/git/<group>/ we owned for a diferent group, then it'll keep the group.

Hiperion
  • 461
  • 6
  • 12
  • But this would create each directory for each user with code duplication, right? – Ashrf Ali Mar 30 '22 at 06:13
  • Yes.... but not: each programmer will have its "cloned" working copy (if possible, in their own computers), and they will push and pull commits, having in the main repo all the same code. Maybe it'll be easier for you to use subversion instead of git (As opposed to git, is a centraliced system). – Hiperion Mar 30 '22 at 10:35