7

I'm using git for several project at the same time. Apparently I have a global setting with username, etc. What I want to maintain is different user name, email, etc for different project. How to achieve this?

lang2
  • 11,433
  • 18
  • 83
  • 133
  • 3
    You can use the --local config option instead of global see http://stackoverflow.com/questions/9063176/git-multiple-user-names-for-the-different-projects-within-the-same-system – Jake C. Jun 14 '15 at 16:03

1 Answers1

14

Just use the git config command without the --global parameter.

Instead of

git config --global user.name "lang2"

Type

git config user.name "lang2"

As described in the documentation, global configurations are stored in ~/.gitconfig, and per repository configuration resides in .git/config.

suvayu
  • 4,271
  • 2
  • 29
  • 35
tjati
  • 5,761
  • 4
  • 41
  • 56
  • Do you know if it is possible to add a tracked configuration as well? Such that the config will be available on each checkout? I was thinking about adding a `.gitattributes` filter to clean up files prior to comitting, and it would make sense to do this for each collaborator. – exhuma May 23 '18 at 07:46