There are a bunch of questions on sharing a git clone folder among several users, but everything seems to be for Linux (two are linked below). I have the same issue, but for a windows machine. I'm hoping others have done this and have a recommended process.
The hope was that since each user has their own login, each would have their own credentials in the windows credential manager, and their own .ssh folder for keys. This would be sufficient if each user cloned their own version of a repository for doing work.
What, though, happens if user A clones to a directory and logs out, then user B logs in and tries wants to do a pull (to fetch/merge new commits from the remote), make some changes, and push a new change to the remote? I'd like this to succeed, with separate commit info (author info) for each user.
Is --shared
helpful in this case? Is there a way to have git's global config apply (name/email, which would be different for each login) vs. user A's information (from the initial git clone, in .git/config)? Is this even possible?
[edit]
Adding detail about the use-case. This was requested in the comments.
I've got a build process that I've automated a fair amount with scripts. It requires a properly configured machine (multiple compilers, patches, etc) and several 3rd party components. The build involves cloning ~50 different repositories, generating makefiles, make, make install (in a specific order on the repos), then running additional packaging/build steps. This takes hours, multiplied by several build configurations for a clean build. To speed up the process, the scripts will generate heuristics that identify whether steps in the chain need to be run (I.e., make can tell if it needs to be rerun, but that doesn't help with make install
or subsequent steps). The end result is an installer. We have full rebuilds ~6 months apart for new versions (where we may update the configuration (compiler, etc)), and have minor releases that involve updating and/or adjusting a subset of the repos (push and pull). The scripts may need modification as well, they are in their own git repo.
While the scripting makes the task something I can do without taking too much bandwidth, I'd like to enable a few others on the team to run these steps. Herein lies the dilemma. The "easy" solution is to have a shared account, but that actually makes the git part of this trickier (ssh keys, github tokens), and has many other downsides. Keeping multiple instances of this environment, one for each developer, would be "best" but creates a new problem of synchronizing the machine environment. It also means one developer can't 'help' the others by kicking off long-running processes for them (they'd need to be run by each different account/machine). Allowing multiple developers to use different accounts, but work on the same machine and within the same folder structure seemed like the best compromise.
In effect, the real problem is the build environment. While there are ways to address that (chef, artifact repositories, etc, etc), manually setting up the build environment and sharing the git repos ("exceptional" use of git) seemed reasonable in this case, if it is possible. Thus the question.
[/edit]
[1] Git - multiple users using the same working dir: permissions issues in .git meta-files