The Nastiest Git Script I Love To Use

TAGS: GIT, SNIPPET

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.

Subscribe to my newsletter!
You'll get notified via e-mail when new articles are published. I mostly write about Docker, Kubernetes, automation and building stuff on the web. Sometimes other topics sneak in as well.

Your e-mail address will be used to send out summary emails about new articles, at most weekly. You can unsubscribe from the newsletter at any time.

Für den Versand unserer Newsletter nutzen wir rapidmail. Mit Ihrer Anmeldung stimmen Sie zu, dass die eingegebenen Daten an rapidmail übermittelt werden. Beachten Sie bitte auch die AGB und Datenschutzbestimmungen .

vsupalov.com

© 2024 vsupalov.com. All rights reserved.