4 ms·
In my .ssh/config, I have a section Host github_as_pulp Hostname github.com User git IdentityFile ~/.ssh/pulp.../id_rsa IdentitiesO
by reacweb 3y ago
In my .ssh/config, I have a section
Host github_as_pulp
Hostname github.com
User git
IdentityFile ~/.ssh/pulp.../id_rsa
IdentitiesOnly yes
I just need to replace github.com by github_as_pulp on my clone command to use my second github account. As it remains in .git/config, it matches automatically when I cd between repositories.
In another script, I have
GIT_SSH_COMMAND="ssh -i /.../.ssh/id_rsa -F /dev/null" git archive --remote=git@bor...fr:ace/docsite.git master | tar xp docsiteapp
git and ssh are so versatile. I think that a little documentation is better than a new tool.
- mladen5 3y agoI currently use the same thing and the issue is that you can't simply clone repo by copying url, you need to edit it each time. Not sure how does your GIT_SSH_COMMAND achieves in this case?
- blueflow 3y ago> I think that a little documentation is better than a new tool. Too many people don't enjoy reading the manpages.
- kstrauser 3y agoSame. I skimmed the article, thinking “but that’s already built in?” I have multiple SSH keys on my computer filling different roles (work, personal, niche hobby stuff). I set them up like you did, and then never think about it again.
- retrocryptid 3y agoCame here to make the same comment. I do mostly the same thing (and created an alias to make it less cumbersome to type.) But... I guess if you didn't want to type this and were okay with an additional dependency, gitid has the advantage that you just have to remember what identity is current.