Follow

TIL – Using conditional entries in .gitconfig to automatically manage identities based on the working directory. Nice!

dev.to/maxlmator/maintaining-d

@jomo What is the benefit compared to `using git config user.name="Firstname Lastname"` and `git config [email protected]` while being in `~/work/`? This will be stored in `~/work/.git/config`

@lx242 @jomo this works for all repositories below ~/work, not just one.

@clonejo @jomo Ah, got it. Thanks for the clarification. Might indeed spare some headache.

@lx242 @jomo Neat idea. I switch computers all the time and forgetting to set this happens all the time 👍

Das habe ich irgendwann mit direnv hingebogen, weil ich diese Lösung nicht kannte. Nun frage ich mich, ob ich es ändern sollte. ;)

@jomo oh wow, thanks, I definitely didn't know about this and it will be very useful! thanks again!

@jomo @schm interesting. I use direnv for exactly the purpose described in the screenshot, I’ll keep it mind should this not be enough though.

Sign in to participate in the conversation
Mastodon

mstdn.io is one of the instance in the fediverse. We're an open-minded generalistic instance. Learn more here!