Created
April 9, 2020 13:17
-
-
Save gidgid/59e34f38b831cae06b18d2dfc9c73466 to your computer and use it in GitHub Desktop.
Frequently used Git with FZF aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Navigate to branches using FZF | |
| cof = "!checkout_fzf() { git branch | fzf | xargs git checkout; }; checkout_fzf" | |
| # Add files using FZF | |
| af = "!add_fzf() { git status -s | awk '{print $2}' | fzf -m | xargs git add; }; add_fzf" | |
| # Add files using FZF and immediately commit them | |
| afmend = "!add_fzf_amend() { git status -s | awk '{print $2}' | fzf -m | xargs git add && git amend; }; add_fzf_amend" | |
| # Restore files (like removing multiple files from the staging area) | |
| ref = "!restore_fzf() { git status -s | awk '{print $2}' | fzf -m | xargs git restore; }; restore_fzf" | |
| # Delete untracked files using FZF | |
| rmf = "!delete_untracked() { git ls-files --exclude-standard --other | fzf -m | xargs rm; }; delete_untracked" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment