Advanced git-checkout

This commit is contained in:
Andrew Tomaka 2023-05-25 21:18:04 -04:00
parent de5a133313
commit 8bd52e2017
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
2 changed files with 11 additions and 1 deletions

View file

@ -24,7 +24,7 @@ alias gc="git commit"
alias gca="git commit --amend"
alias gcl="git commit -m 'Linting'"
alias gcn="git commit --allow-empty --message 'noop'"
alias gco="git checkout"
alias gco="advanced-git-checkout"
alias gcp="git cherry-pick"
alias gcs="git commit -m '¯\_(ツ)_/¯'"
alias gct="git commit -m '( ͡° ͜ʖ ͡°)'"

View file

@ -1,3 +1,13 @@
function advanced-git-checkout {
if [ $# -eq 0 ]; then
git branch \
| fzf \
| xargs -I {} git checkout {}
else
git checkout $@
fi
}
function ag-count {
if [ $# -lt 1 ]; then
echo Usage: ag-count SEARCHTERM