.dotfiles/.config/bash/git.bash
2024-06-23 11:51:38 +02:00

39 lines
970 B
Bash

function gi() {
local IFS=,
curl -fL "https://www.toptal.com/developers/gitignore/api/$*"
}
function _gi() {
mapfile -t COMPREPLY < <(compgen -W \
"$(curl -sfL https://www.toptal.com/developers/gitignore/api/list | tr ',' '\n')" \
-- "${COMP_WORDS[1]}")
}
complete -F _gi gi
alias g='git' \
ga='git add' \
gaa='git add --all' \
gap='git apply' \
gb='git branch' \
gbl='git blame -w' \
gbs='git bisect' \
gc='git commit --verbose' \
gca='git commit --verbose --all' \
gcl='git clone' \
gco='git checkout' \
gcp='git cherry-pick' \
gd='git diff' \
gdup='git diff @{upstream}' \
gf='git fetch' \
gl='git pull' \
glo='git log --oneline --decorate' \
gmr='git merge' \
gr='git remote' \
grb='git rebase' \
grev='git revert' \
grh='git reset' \
grs='git restore' \
gst='git status' \
gsta='git stash'