Skip to content

Instantly share code, notes, and snippets.

@gidgid
Last active October 13, 2019 13:42
Show Gist options
  • Save gidgid/c12f48fb41d6575121b4ab7af6f17ac5 to your computer and use it in GitHub Desktop.
Save gidgid/c12f48fb41d6575121b4ab7af6f17ac5 to your computer and use it in GitHub Desktop.
Git aliases with FZF
[alias]
# more aliases here
## "checkout fzf" checkout with fzf
cof = "!checkout_fzf() { git branch | fzf | xargs git checkout; }; checkout_fzf"
## "add fzf" add multiple files with fzf
aaf = "!add_fzf() { git status -s | awk '{print $2}' | fzf -m | xargs git add; }; add_fzf"
## "add files and commit" add files with fzf and then immediately commit
afc = "!add_files_and_commit() { git status -s | awk '{print $2}' | fzf -m | xargs git add && git commit --verbose; }; add_files_and_commit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment