crtxdmp.

A collection of ideas, snippets and other things.


Different git configurations per folder

When you own multiple git accounts (e.g. work for multiple companies) you probably don´t want to change your main config file.
In git you can include a config based on the directory where the repository is stored.

File: ~/.gitconfig
[includeIf "gitdir:/Users/YOUR_USER/Projects/[SPECIAL]/"]
    path = ~/.git/.gitconfig-[SPECIAL]

And for all repositories under /Users/YOUR_USER/Projects/[SPECIAL]/ it will extend your main config with
.gitconfig-special which could look like this

File: ~/.gitconfig-special
[user]
	name = Your Real Name
	email = [email protected]
	signingkey = SIGNING_KEY_ASSOCIATED_WITH_THIS_EMAIL_ADDRESS

P.S. this is also useful if you use another account e.g. for github

— Mar 19, 2021