Latest
Git push directly to another workstation
You don’t need GitHub to work with git on multiple computers, and you don’t even need a git remote set up to do it.
Sometimes I’m working on some code that is incomplete, or is speculative, or there’s another reason that I don’t want to push it to the remote branch yet, but I need to swap from my desktop to my laptop or vice versa.
Git is a distributed version control system, but I think people often forget
what that implies. A git repository can be as simple as a directory available
via ssh, which means that your other computer is already a git repository
as long as you can ssh to it.
Furthermore, you don’t have to go through the ceremony of setting your other
computer up as a named git remote; if you can ssh to it, you can access it
directly using a properly-constructed URL:
git push ssh://mylaptop.local/~/path/to/repo
You can do this for pull, push, fetch, and any other command where you’d
normally use a named remote.
There are some caveats:
- The remote directory has to have a git repository already; if not, you’ll
have to
sshin and create one withgit init path/to/repo(it will even create the intervening directories for you). - You can’t (by default) push to the currently active branch on the remote; create or use a different branch instead.
But most of the time, I’ve already been working on the same codebase on the other machine. I have something that isn’t quite ready yet, so I make a work-in-progress commit on a new branch, send it across, and pick up where I left off.
Older
Week 280: Six days’ notice
Amazon sent me an email on 14 May to tell me that my old Kindle would be completely unsupported “Starting May 20, 2026” – i.e. six days later.
Using a U2F key instead of a password on Linux
This is an update and expansion on something I wrote a few years ago about using my SoloKey U2F USB key for passwordless
sudo.Week 279: Two out of three
Week 278: Jack in the Green
May Day fell on Friday this year, and what better way is there to celebrate workers than by not doing any work? It was hot and sunny, so I slathered on some sun cream, put on a hat, and went down to Deptford to catch the Jack in the Green procession.
Older entries can be found in the archive.