# different name and email address depending on folder

4 messages from 2011-01-08 to 2011-01-08. Participants: Rich Eakin, Ramkumar Ramachandra.
Thread: https://gitlist.dev/t/26238

## Rich Eakin, 2011-01-08 00:52

Subject: different name and email address depending on folder
Message-ID: <3178E076-FA22-4C3C-BEB2-2581A0E12086@gmail.com>
URL: https://gitlist.dev/e/3178E076-FA22-4C3C-BEB2-2581A0E12086%40gmail.com

```
Hi,

I am using git for development with a company and myself on the same computer and the name / user fields need to be different for each.  As I keep all my company's repos in one directory and my private stuff in another, I was wondering if there is a way to tell git to use a separate user and email whenever I make commits from within a specified directory.  

If anyone can tell me how to do this, or some other way to achieve my needs, I am very thankful.

Best Regards,
Rich
```

## Ramkumar Ramachandra, 2011-01-08 07:39

Subject: Re: different name and email address depending on folder
Message-ID: <20110108073928.GD27334@kytes>
URL: https://gitlist.dev/e/20110108073928.GD27334%40kytes
In-Reply-To: <3178E076-FA22-4C3C-BEB2-2581A0E12086@gmail.com>

```
Hi Rich,

Rich Eakin writes:
> I am using git for development with a company and myself on the same computer and the name / user fields need to be different for each.  As I keep all my company's repos in one directory and my private stuff in another, I was wondering if there is a way to tell git to use a separate user and email whenever I make commits from within a specified directory.  

Yes. Please see the 'user.name' and 'user.email' configuration options
in git-config(1). You can set them globally or on a per-repository
basis.

-- Ram

```

## Rich Eakin, 2011-01-08 08:16

Subject: Re: different name and email address depending on folder
Message-ID: <A1770B45-1A98-49C3-8CD0-C61A51FFB66E@gmail.com>
URL: https://gitlist.dev/e/A1770B45-1A98-49C3-8CD0-C61A51FFB66E%40gmail.com
In-Reply-To: <20110108073928.GD27334@kytes>

```
I am currently using git-config in a bash script to set my user / email.  I was wondering if it was possible to tell git that if I am in a certain directory to use a specific user / email other than what is in my global config.  


On 08/01/2011, at 6:39 PM, Ramkumar Ramachandra wrote:

> Hi Rich,
> 
> Rich Eakin writes:
>> I am using git for development with a company and myself on the same computer and the name / user fields need to be different for each.  As I keep all my company's repos in one directory and my private stuff in another, I was wondering if there is a way to tell git to use a separate user and email whenever I make commits from within a specified directory.  
> 
> Yes. Please see the 'user.name' and 'user.email' configuration options
> in git-config(1). You can set them globally or on a per-repository
> basis.
> 
> -- Ram

```

## Ramkumar Ramachandra, 2011-01-08 08:29

Subject: Re: different name and email address depending on folder
Message-ID: <20110108082957.GE27334@kytes>
URL: https://gitlist.dev/e/20110108082957.GE27334%40kytes
In-Reply-To: <A1770B45-1A98-49C3-8CD0-C61A51FFB66E@gmail.com>

```
Hi Rich,

Rich Eakin writes:
> I am currently using git-config in a bash script to set my user / email.  I was wondering if it was possible to tell git that if I am in a certain directory to use a specific user / email other than what is in my global config.  

It's possible on a per-repository basis, as I pointed out in the last
email; but no- I don't think it's possible on a per-directory basis
within the same repository. You might consider separting your private
work from your company's repository.

p.s- I think you've used the term "global" incorrectly here. Global
configuration applies to all repositories. Per-repository
configuration overrides the global configuration for that repository.

-- Ram

```
