{"thread":{"id":"26238","subject":"different name and email address depending on folder","startedAt":"2011-01-08T00:52:22Z","lastAt":"2011-01-08T08:29:59Z","messageCount":4,"participants":["Rich Eakin","Ramkumar Ramachandra"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159191","messageId":"3178E076-FA22-4C3C-BEB2-2581A0E12086@gmail.com","threadId":"26238","inReplyTo":null,"subject":"different name and email address depending on folder","fromName":"Rich Eakin","fromEmail":"reakinator@gmail.com","sentAt":"2011-01-08T00:52:22Z","receivedAt":"2011-01-08T00:52:22Z","isPatch":false,"sender":{"key":"reakinator@gmail.com","avatar":null},"body":"Hi,\n\nI 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.  \n\nIf anyone can tell me how to do this, or some other way to achieve my needs, I am very thankful.\n\nBest Regards,\nRich"},{"id":"159202","messageId":"20110108073928.GD27334@kytes","threadId":"26238","inReplyTo":"3178E076-FA22-4C3C-BEB2-2581A0E12086@gmail.com","subject":"Re: different name and email address depending on folder","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2011-01-08T07:39:30Z","receivedAt":"2011-01-08T07:39:30Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi Rich,\n\nRich Eakin writes:\n> 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.  \n\nYes. Please see the 'user.name' and 'user.email' configuration options\nin git-config(1). You can set them globally or on a per-repository\nbasis.\n\n-- Ram\n"},{"id":"159204","messageId":"A1770B45-1A98-49C3-8CD0-C61A51FFB66E@gmail.com","threadId":"26238","inReplyTo":"20110108073928.GD27334@kytes","subject":"Re: different name and email address depending on folder","fromName":"Rich Eakin","fromEmail":"reakinator@gmail.com","sentAt":"2011-01-08T08:16:20Z","receivedAt":"2011-01-08T08:16:20Z","isPatch":false,"sender":{"key":"reakinator@gmail.com","avatar":null},"body":"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.  \n\n\nOn 08/01/2011, at 6:39 PM, Ramkumar Ramachandra wrote:\n\n> Hi Rich,\n> \n> Rich Eakin writes:\n>> 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.  \n> \n> Yes. Please see the 'user.name' and 'user.email' configuration options\n> in git-config(1). You can set them globally or on a per-repository\n> basis.\n> \n> -- Ram\n"},{"id":"159205","messageId":"20110108082957.GE27334@kytes","threadId":"26238","inReplyTo":"A1770B45-1A98-49C3-8CD0-C61A51FFB66E@gmail.com","subject":"Re: different name and email address depending on folder","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2011-01-08T08:29:59Z","receivedAt":"2011-01-08T08:29:59Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi Rich,\n\nRich Eakin writes:\n> 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.  \n\nIt's possible on a per-repository basis, as I pointed out in the last\nemail; but no- I don't think it's possible on a per-directory basis\nwithin the same repository. You might consider separting your private\nwork from your company's repository.\n\np.s- I think you've used the term \"global\" incorrectly here. Global\nconfiguration applies to all repositories. Per-repository\nconfiguration overrides the global configuration for that repository.\n\n-- Ram\n"}]}