On my work laptop I have git global config
with my work email and it has to be like this. But when I commit to my personal project I will see my work email git user in git history. Of course I don't want this, I want that my git history will be clean for each project I'm working on.
It's very important to say, that I'm writing about hobby/pet project and not side business or smth like this.
So, how can I use different git users for my git history for different git repos. It's very simple, I need to use local git config
per project.
On my work laptop I used these git settings:
git config --global user.email "xxxx@xxxx.com"
git config --global user.name "Avi Rynkov"
For my pet project I use these settings:
# in the project folder
git config --local user.email "xxxx@xxxx.com"
git config --local user.name "Avi Rynkov"
And then, when you will commit, you will see the local user in the git history.
Have a nice day! Work on your pet projects and don't stop to learn something new!