Git without the Hub
Git earns its place in every project I start. GitHub is a different story: great for async collaboration with a team, but overkill for most of my solo work.
Solo projects are where I learn & experiment with something new. The only features of git I actually need for them are:
- Atomic commits that can easily be reverted or cherry-picked
- Branches for larger changes
- An overview of the project’s history
Pull requests and CI/CD actions aren’t necessary. I don’t even need to clone
the repo to another computer. I’m a fan of trunk based
development (a habit from my time at
Etsy), so I commit to main and keep moving.
Bare origins
Since git is decentralized, you can set your origin repo to pretty much any
kind of file storage location. My projects all begin on an external
hard drive /dev/sdc1 which is mounted to /media/lab on my machine.
This allows me to create a bare repo to use as my origin for a new experiment without needing to authenticate over the internet:
git init --bare /media/lab/experiment
Then I can clone it to my local machine and get to work:
git clone /media/lab/experiment ~/Workspace/experiment
Or if I already have a local experiment repo and want to push it to the bare origin:
git remote add origin /media/lab/experiment
git push origin main
If I need to access it from different machines without juggling the hard drive between them, I set up the bare repo on a VPS via ssh and host it on a subdomain:
git remote set-url origin [email protected]:experiment.git
I’ll also move things here when the work is important enough to warrant a backup.
Finally if the experiment becomes successful enough to share with others, I can easily update the origin to a public location such as GitHub:
git remote set-url origin [email protected]:ahashim/experiment.git
Once the repo is set up and commits are flowing, I want to keep track of what I’ve accomplished.
Bird’s eye view
To see the big picture, the git log gives me a quick rundown of what I’ve built so far:
git log --all --decorate --graph

However, I find it useful to have a UI that displays the diffs alongside the commit log for added context. Lazygit is an excellent command line utility for this:
lazygit

If I need a desktop GUI to scroll around & have full mouse capabilities, then I’ll quickly fire up a Git WebUI server for a visual interface:
git webui

This gives me a page that I can bookmark in the browser, and leave open in a tab while working to give me an overview of my progress.
It doesn’t have all the GitHub UI bells & whistles, but it covers everything I need while I focus on the actual experiment.
This workflow strips git down to what solo work actually uses: fast commits
and instant reverts, all in the terminal. And when an experiment does grow
into something worth sharing, GitHub is one git remote set-url away.