Hi,

I am trying to find a good solution to this use-case that seems to require 
expansion in the .gitconfig file:

1. Multiple users share the same account on a machine (this is using CoCalc 
<http://cocalc.org> where the user is the project id so changing this is 
not an option).
2. We would like to be able to use git, but with proper recording of which 
user made the commit.

I work this with mercurial by having each user set an environment variable 
when they log in, and then adding the following to the project .hgrc file:

[ui]
username = $LC_HG_USERNAME

This fails in the .gitconfig file as expansion is not performed 
<https://stackoverflow.com/questions/11262010/shell-variable-expansion-in-git-config/11262153#11262153>.
  
A workaround suggested there is to do something like this in the .bashrc 
file:

git config --global user.name=$LC_GIT_USERNAME


This means, however, that all commits will be logged as the last user who 
logged in - which mucks up the use case where multiple people might be 
logged in at the same time.

Any suggestions for how to get git to work nicely in this case?

Thanks,
Michael.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to