Pages: Welcome | Projects

Git Push speedup hack, with Systemd


It is two years already I've published that quick post about how to speed-up your GitHub interaction. Well, I used it a lot, and of course not just with GitHub. And an interesting idea popped into my mind: using it within your Systemd configuration…

There are a couple of places from which Systemd can load unit files on behalf of your user. They can be found in the systemd.unit manpage.

Here's the content of my $HOME/.config/systemd/user/keepup@.service:

Description=Persistent ssh connection towards %i

ExecStart=/usr/bin/ssh -v -N %i

Given this configuration in my /.ssh/config:

ControlMaster auto
ControlPath /tmp/ssh-%u@%l-%r@%h:%p

    User git
    IdentityFile ~/.ssh/github-id_rsa

I can simply run the following:

systemctl --unit start

And I don't really need to have a shell open for it anymore :)