vsupalov

The Nastiest Git Script I Love To Use

It’s called changes.

Here’s how I tend to use it:

# editing a file in a Git project
$ git add $FILE_I_CHANGED
$ changes

It needs to be located in a PATH-included directory, I usually put mine into an own folder called ~/local/bin.

Not For Team Use

I wouldn’t run it on a non-private non-early-stage project. All it does, is create a new commit with the message “changes” and push it.

The script?

#! /bin/bash

set -euo pipefail

git commit -m "changes"
git push

Because most commits for my private projects won’t benefit from a more informative message, and I value the reduced friction.

It’s been surprisingly handy. Yes, it’s kind of nasty, but my “tiny tweak” workflows have never been more smooth and enjoyable.