TIL: Git push to deploy

Half a year ago, I wrote about how to push Git repos between random repos. But at the time, I did it like a farmer, having to change the branch on the remote machine before pushing.

Today, after fighting with piku, which is really nice, except it doesn't support ASGI, so FastAPI, I got back to deploying the old way, and I learned about the updateInstead option for Git.

$ git config receive.denyCurrentBranch updateInstead

Run this on the remote repository and when you will push to it, it will update the working tree to match the latest changes.

Voila, even simpler setups.

And one of these days, I'll automate it even further.