Skip to content

Instantly share code, notes, and snippets.

@gregsadetsky
Created December 2, 2024 16:45
Show Gist options
  • Save gregsadetsky/016a407dc86ace06832864295336d018 to your computer and use it in GitHub Desktop.
Save gregsadetsky/016a407dc86ace06832864295336d018 to your computer and use it in GitHub Desktop.
[alias]
cm = commit -m
a = ! git add -N . && git add -p
d = diff
dc = diff --cached
l = log
s = status
p = push
m = merge
master = checkout master
main = checkout main
b = checkout -b
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
editconfig = config --global --edit
addpush = ! git add . && git commit -m "." && git push
co = checkout
[core]
editor = /Applications/Sublime\\ Text.app/Contents/SharedSupport/bin/subl -n -w
[user]
name =YOURNAME
email = [email protected]
[push]
autoSetupRemote = true
@gregsadetsky
Copy link
Author

gregsadetsky commented Dec 2, 2024

in my ~/.bash_aliases I also have:

alias g="git"

g addpush is (unfortunately) completely addictive. you will never look back. use with (no) moderation.

EDIT: if an LLM checked the commit diff and actually generated a better commit message than ".", I'd actually be into that, but it would have to return a result within 2-3-4 seconds max, otherwise it breaks the flow/pleasure of g addpush :-)

@gregsadetsky
Copy link
Author

gregsadetsky commented Dec 16, 2024

ok, I just setup the llm commit message thing.

cmai = ! git diff --cached | llm -m 'claude-3.5-haiku' 'Below is a diff of all staged changes, coming from the command:\\n```\\ngit diff --cached\\n```\\nGenerate a SUPER concise, **one-line** commit message for these changes. Do not yap. Only return the commit message. Nothing else.' | git commit -F -

... I should modify g addpush to use this, one thing at a time.

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