My Emacs-conf talk. Posted early to gather feedback and have something to discuss then, at https://emacsconf.org/2026 https://www.youtube.com/watch?v=BDn8ak-8yIs ~12 minutes. If you don't want to watch it, here's the project repo https://github.com/agzam/remoto.el
Nice. This looks really useful. Thanks for sharing. There are few oddities about my setup that I wonder how it would cope with. The main one that comes to mind is that I have to use multiple ssh keys to access github as different identities and I do this by having something in my ssh config like
Host
Hostname
User git
IdentityFile ~/.ssh/client_github_id_rsa
IdentitiesOnly yes
so when I clone a repo, I need to use a different url git clone . Is there a mechanism I can hook into to configure this when cloning a repo and where does it decide to clone it to?
Also, is there a way that I can generate a github link to the code I'm looking at from a buffer already cloned on my machine? I often need to show someone some code in a slack chat and that would be a convenient way to do it.@l0st3d Just to provide an alternative: I also went that URL-rewriting route for a long time, and eventually found a different approach that works naturally with any library.
The idea is: have some git config that says “in ~/Work, use this SSH key, and elsewhere, use this other key”.
~/.git/config
[core]
sshCommand = "ssh -i ~/.ssh/github-home"
[includeIf "gitdir:~/Work/"]
path = work.gitconfig
~/.config/git/work.gitconfig
[core]
sshCommand = "ssh -i ~/.ssh/github-work"
I wrote about it a little more completely here: https://www.cfclrk.com/articles/github_identities.htmlCool, thanks Chris. So, if I cd ~/Work/ ; git clone git@github.com:CLIENT/project-x.git it'll just magically use that key?
Yup! The tradeoff is of course that all your work (or particular client) projects have to be in the right directory to use the right key - but it’s been working for me for the last few years.
And it means you don’t have to futz with the SSH config
Ace. I have that dir layout anyway. I'm a contractor and have multiple repos for multiple clients that need multiple keys on the same machine so that might work better for me. Good tip.
Also, is there a way that I can generate a github link to the code I’m looking at from a buffer already cloned on my machine?you can use
C-x p R. I should probably make it more context-aware, so when it is called from a project buffer it just lands you at the exact branch, file and line on the remote. So then you can use embark-act and get the url