29
.
04
.
2024
4
.
11
.
2022
Backend
Tutorial

How to use different git emails for different projects

Michał Łęcicki
Ruby Developer

Working in a software house means changing projects from time to time. Usually, I have to use a separate git account for a new project. But I don't want to delete my original account, rather I'd like to have both. It's easy to solve, but surprisingly I see many people have problems with it. Here's the solution.

First of all, for each project/projects group add a custom .gitconfig file - (/Projects/project/.gitconfig) with desired git configuration:

[user]
  name = Michal Lecicki
  email = michal.lecicki@project.com

In another project, I could have a little different data:

[user]
  name = Michal Lecicki
  email = mlecicki@another_project.com

Finally, make a global git setup aware of additional configuration. Add to top-level .gitconfig file:

[user] # my default settings
  name = maikhel
  email = maikhel@maikhel.pl
[includeIf "gitdir:~/Projects/project/"]
  path = ~/Projects/project/.gitconfig
[includeIf "gitdir:~/Projects/another_project/"]
  path = ~/Projects/another_project/.gitconfig
(...)

This way I make sure that my commits are signed with the correct email for each client. It helps to look professional and doesn't break Jira/Trello/other magic tool integration which identifies user actions by email.

Michał Łęcicki
Ruby Developer

Check my Twitter

Check my Linkedin

Did you like it? 

Sign up To VIsuality newsletter

READ ALSO

Let’s prepare for GITEX Dubai together!

11
.
06
.
2025
Michał Piórkowski
Conferences
Business

Ruby Quirks

11
.
06
.
2025
Jan Matusz
Ruby on Rails
Ruby

Visuality recognized as one of the Best Ruby on Rails Devs

11
.
06
.
2025
Maciej Zdunek
Ruby on Rails
Visuality
Business

Let’s prototype!

11
.
06
.
2025
Michał Łęcicki
Ruby on Rails
Backend

Between the devil and the deep blue sea

11
.
06
.
2025
Mateusz Wodyk
Project Management
Backend
HR

Is the culture of the organization important?

11
.
06
.
2025
Alicja Gruszczyk
Conferences
Visuality

5 marketing hacks which will make your life easier

11
.
06
.
2025
Maciej Zdunek
Marketing
Design

Marketing hacks #01: How to Track off-line conversions

11
.
06
.
2025
Marek Łukaszuk
Ruby on Rails
Business
Marketing

JSON:API consumption in Rails

11
.
06
.
2025
Jan Matusz
Ruby on Rails
Backend
Tutorial

Selected SXSW lectures takeaways

11
.
06
.
2025
Michał Piórkowski
Conferences
Frontend
Backend
Business

Common communication issues in project management

11
.
06
.
2025
Michał Krochecki
Project Management

SXSW Summary

11
.
06
.
2025
Michał Piórkowski
Ruby on Rails
Conferences
Frontend
Backend
Business

How to get the most out of SXSW Interactive

11
.
06
.
2025
Michał Krochecki
Ruby on Rails
Conferences
Frontend
Backend
Business

Guide to recruitment at Visuality

11
.
06
.
2025
Michał Piórkowski
HR
Visuality

TOP Ruby on Rails Developers

11
.
06
.
2025
Maciej Zdunek
Ruby on Rails
Visuality
Business

How to conquer Westworld?

11
.
06
.
2025
Maciej Zdunek
Business
Marketing

2018 Rewind by Visuality

11
.
06
.
2025
Michał Krochecki
HR
Visuality

Quality Assurance Testing

11
.
06
.
2025
Jarosław Kowalewski
Ruby on Rails
Backend

Why do we like to be together?

11
.
06
.
2025
Michał Krochecki
Visuality
HR

Wallboards - a great value for our teams and clients

11
.
06
.
2025
Michał Krochecki
Ruby on Rails
Design
Project Management
Backend

2018 Clutch Global Leader

11
.
06
.
2025
Maciej Zdunek
Ruby on Rails
Visuality
Business
Marketing