Re: feature request: user email config per domain
- From
Pranit Bauva <pranit.bauva@gmail.com>
- Date
- Feb 22, 2017, 13:51 UTC
- Message-ID
- <CAFZEwPNEeCyVUbaU2J_9CuqCnvRjMR0DuHjz9cM81DzN0MYN8g@mail.gmail.com>
- In-Reply-To
- <CAN0Skmmjd5Y0uWz_WC69mAStucZ6nR0mjdp4-ODJz2UnTaB-eQ@mail.gmail.com>
Hey Tushar,
When you run `git config --global user.email abc@xyz.com` it writes out this setting in ~/.gitconfig which is then considered to be "global" ie. this same email will be used for every repo, but ...
You can always override this. Let's say there is a repo named "foo" in which you want the email "xyz@abc.com", then you go inside that folder and type `git config user.email xyz@abc.com`. Note: the option `--global` is skipped here. This creates a file `.gitconfig` in the folder "foo" and now whenever you commit, the .gitconfig file inside the repo will get the first preference and then the global ~/.gitconfig.
This will work for you assuming that you have different repos for your company and for your open source work. Will this solve your problem?
Regards, Pranit Bauva