Skip to content

Instantly share code, notes, and snippets.

@gwpl
Last active July 4, 2024 14:06
Show Gist options
  • Save gwpl/dd668e701b37c72e3ea135b9f5f57ed7 to your computer and use it in GitHub Desktop.
Save gwpl/dd668e701b37c72e3ea135b9f5f57ed7 to your computer and use it in GitHub Desktop.
[alias]
exec = "!f() { (cd \"$GIT_PREFIX\" && eval \"$@\" && git add -A && git commit -m \"$ $*\"); }; f"

https://x.com/GWierzowiecki/status/1808864723506770437

🔧 Create ergonomic record keeping in your #Git repo with a handy config alias. Executes comma nds, stages & commits results with the command as the commit message. `👇

[alias]
    exec = "!f() { (cd \"$GIT_PREFIX\" && eval \"$@\" && git add -A && git commit -m \"$ $*\"); }; f"

Use it like: git exec 'cmd params... && cmd params... ; cmd params...' 💻 #git #cli #terminal #plaintext

P.S. also on gist, most fresh version: https://gist.github.com/gwpl/dd668e701b37c72e3ea135b9f5f57ed7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment