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

Summary of Phoenix workshop at Visuality

11
.
06
.
2025
Karol Słuszniak
Ruby on Rails
Visuality
Backend

CS Lessons #001: Working with binary files

11
.
06
.
2025
Michał Młoźniak
Ruby
Software

CS Lessons #000: Introduction and motivation

11
.
06
.
2025
Michał Młoźniak
Ruby
Software

Working with 40-minute intervals

11
.
06
.
2025
Sakir Temel
Software
HR

THE MATURE TECH STARTUP DILEMMA: WHAT'S NEXT

11
.
06
.
2025
Susanna Romantsova
Startups

Win MVP workshop!

11
.
06
.
2025
Susanna Romantsova
Startups

FINTECH WEEK IN OSLO: WHATs & WHYs

11
.
06
.
2025
Susanna Romantsova
Conferences

MY FIRST MONTH AT VISUALITY

11
.
06
.
2025
Susanna Romantsova
Visuality
HR

NASA 1st global hackaton in Poland? Visuality Created it!

11
.
06
.
2025
Rafał Maliszewski
Ruby on Rails

Berlin StartupCamp 2016 summary

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

Investment Days for productivity

11
.
06
.
2025
Rafał Maliszewski
Visuality
HR

Happy new year

11
.
06
.
2025
Michał Piórkowski
Visuality

Does Norway need Polish software development?

11
.
06
.
2025
Rafał Maliszewski
Ruby on Rails

Visuality is 8 years old

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

Use less javascript plugins

11
.
06
.
2025
Michał Młoźniak
Frontend

Front-Trends 2015

11
.
06
.
2025
Adam Król
Frontend

Automatic door opener controlled through slack

11
.
06
.
2025
Sakir Temel
Backend
Software
Tutorial

Wolves Summit

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

Berlin Startup Camp

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

Why you shouldn't work at Visuality

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

SaaS Meetup #People

11
.
06
.
2025
Michał Piórkowski
Conferences

Startup Safary Berlin 2015

11
.
06
.
2025
Michał Piórkowski
Conferences

Optional dependencies in gems

11
.
06
.
2025
Karol Słuszniak
Ruby on Rails
Backend

Emmet makes HTML and CSS easier

11
.
06
.
2025
Michał Piórkowski
Frontend
Tutorial