Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run a git repository locally with multiple users?

Tags:

git

I'm looking to run git to track the changes of files on a single computer that does not have network access. Multiple people will use the computer and each has their own user account. I want to be able to track what changes they make to code and ensure that we know which user made which changes. Is this possible?

like image 787
Daniel Berman Avatar asked May 04 '17 04:05

Daniel Berman


1 Answers

As long as:

  • the git repo has been initialized
  • each user has his/her own git config user.name/user.email correctly set

The users will be able to modify, add, and commit their change to the repo.

The only issue is concurrent changes on the same set of file: it is best if each user has its own clone of the repo, meaning:

  • there is one bare repo
  • each user clone that repo in his/her home directory, and commit there new changes, before pushing back.

In other words, the lack of network does not prevent you to establish one central repo, and multiple clones of that repo, one for each users.

like image 143
VonC Avatar answered Nov 01 '22 01:11

VonC