by er453r · 2y ago · 0 comments
Just keep a .gitconfig in your HOME with aliases for your identities. Then just after initializing/cloning the repo do git config-company or git config-personal
er453r@r7:~$ cat ~/.gitconfig
[user]
useConfigOnly = true
[alias]
config-personal = !echo CONFIG-PERSONAL && \
git config --local user.email 'personal@email.com' && \
git config --local user.name 'personal' && \
git config --local core.sshCommand 'ssh -i ~/.ssh/id_rsa_personal'
config-company = !echo OLD CONFIG-COMPANY && \
git config --local user.email 'official@comapny.io' && \
git config --local user.name 'Name Surname' && \
git config --local core.sshCommand 'ssh -i ~/.ssh/id_rsa_company'I just like this workflow better since it is totally directory/remote agnostic (compared to the article).
Just use whatever suits you best :)
I'm sorry, I don't want to be mean but this has got to be the worst way Ive seen someone try to solve this. I want to cry skimming it. Why would anyone do this and think it's simpler? Wew, gotta just leave this one alone.