Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git: how to have per project configuration? [duplicate]

Tags:

git

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?

like image 560
lang2 Avatar asked Jun 14 '15 16:06

lang2


People also ask

Can I have multiple git configs?

With conditional includes in Git 2.13, it is now possible to have multiple user/email coexist on one machine with little work. user. gitconfig has my personal name and email.


1 Answers

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.

like image 112
tjati Avatar answered Sep 21 '22 21:09

tjati