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

Value Object - DDD in Ruby on Rails

17
.
03
.
2024
Paweł Strzałkowski
Ruby on Rails
Domain-Driven Design
Backend
Tutorial

Introduction to DDD in Ruby on Rails

17
.
03
.
2024
Paweł Strzałkowski
Ruby on Rails
Domain-Driven Design
Backend
Tutorial

Safe data migrations in Rails

17
.
03
.
2024
Paweł Strzałkowski
Ruby on Rails
Backend
Tutorial

I love dev, and so do we!

14
.
11
.
2023
Michał Łęcicki
Software
Conferences

Updated guide to recruitment process at Visuality

14
.
11
.
2023
Michał Łęcicki
Visuality
HR

Visuality Academy for wannabe Junior Engineers

14
.
11
.
2023
Michał Piórkowski
HR
Visuality

How to approach funding as an MVP

14
.
11
.
2023
Michał Piórkowski
Business
Startups

Visuality 13th birthday

14
.
11
.
2023
Michał Piórkowski
HR
Visuality

How To Receive Emails With a Rails App in 2021

14
.
11
.
2023
Michał Łęcicki
Ruby on Rails
Tutorial

Project Quality in IT - How to Make Sure You Will Get What You Want?

14
.
11
.
2023
Wiktor De Witte
Ruby on Rails
Project Management
Business

5 Trends in HR Tech For 2021

14
.
11
.
2023
Maciej Zdunek
Business
Project Management

Is Go Language the Right Choice for Your Next Project?

14
.
11
.
2023
Maciej Zdunek
Backend
Business

SXSW Tradeshow 2020: Get Your FREE Tickets and Meet Us

14
.
11
.
2023
Michał Krochecki
Ruby on Rails
Conferences
Frontend
Backend
Business

How to build effective website: simplicity & McDonald's

14
.
11
.
2023
Lukasz Jackiewicz
Ruby on Rails
Frontend
Design

Thermal Printer Protocols for Image and Text

14
.
11
.
2023
Burak Aybar
Backend
Tutorial
Software

WebUSB - Print Image and Text in Thermal Printers

14
.
11
.
2023
Burak Aybar
Backend
Tutorial
Software

What happened in Visuality in 2019

14
.
11
.
2023
Maciej Zdunek
Visuality
HR

Three strategies that work in board games and in real life

14
.
11
.
2023
Michał Łęcicki
Ruby on Rails