This file stores a few git configurations I use everywhere.
- Create a
.gitconfig
file in the folder you want to have a specific user
nano ~/projects/client-a/.gitconfig
Set your custom user in this file:
[user]
name = My Name
email = [email protected]
- Use this partial git config file in your global git config file
If this file doesn't exist yet, you can create it.
nano ~/.gitconfig
Place this bit at the end of the file
[user]
# global user by default
name = My Name
email = [email protected]
# The trailing slash / is important!
[includeIf "gitdir:~/projects/client-a/"]
path = ~/projects/client-a/.gitconfig # path to the .gitconfig you created in step 1.
# Enable the GitLens UI for interactive rebase
In VSCode, run this command from the Command Palette:
> GitLens: Enable Interactive Rebase Editor
# (Optional) Open all "interactive" git commands in VSCode
git config --global core.editor "code --wait"