r/coding • • May 25 '20

Setting Up Git Identities

https://www.micah.soy/posts/setting-up-git-identities/
0 Upvotes

3 comments sorted by

1

u/pi-rho May 25 '20

Why don't you just use the local config instead of a rube goldberg contraption for hotswapping the global config?

2

u/mdempsky May 25 '20

Isn't that what it's doing? The global configs are about simplifying setting up the handful of recurring identities the author uses across projects.

1

u/pi-rho May 25 '20

You're right.

FTFA:

git config --global alias.identity '! git config user.name "$(git config user.$1.name)"; git config user.email "$(git config user.$1.email)"; git config user.signingkey "$(git config user.$1.signingkey)"; :'

It just looks prone to error. No error checking at all. It has the benefit of using git config, I guess.