10-09-2022 09:54 AM
the git config --local command stores things in the .git/config file inside the repository directory.
Here is an example script I used when working on a clients machine.
I just dropped that script somewhere in the PATH.
then
I would type in "./UserSam.sh set"
That set me as the git user for that repo.
Then when done I would just type in "./UserSam.sh" and it would unset the user and it would go back to whatever the default was.
One could probably refine the shell script more and make it more generic, but it worked.
For the GUIs I have used GitKraken and it just had a drop down. You could have multiple users set up and you just select which one you want to use. You could switch at any time. I assumed most others had that functionality maybe not...
10-10-2022 03:21 PM
Thanks. This is a good thread. I was thinking that sharing instrumentation equipment connected to one PC is probably a corner case the greater software-only world doesn't encounter. -cc
08-17-2023 04:19 PM
We have the same issue with testers running multiple products supported by different people and this is pretty similar to the route we took.
We created a bot user on GitHub with a Personal Access Token for HTTPS access. The token gets stored in the Windows Credential Manager on the various testers.
We have a utility app that runs with an icon in the notification area of the taskbar. Among other features, a right click will get you a login prompt which verifies your credentials on the domain, then populates your name and email in the global git config.
There is also a timeout which clears the fields after 15 minutes (and periodically in the background for the case of someone setting them manually) to help prevent accidentally using someone else's info in the case you forget to "log in". 15 minutes was a good tradeoff in having a little time to perform multiple actions without having to enter your credentials repeatedly, but short enough that it's unlikely someone else will need to do a commit before the timeout occurs. It's not bulletproof, but has been working well enough.