# add to index ga() { git \ add \ "${@}" } # add all to index gaa() { git \ add \ --all \ "${@}" } # add parts of all to index gaap() { git \ add \ --all \ --patch \ "${@}" } # add parts to index gap() { git \ add \ --patch \ "${@}" } # create a branch gb() { git \ branch \ "${@}" } # delete a branch gbd() { git \ branch \ --delete \ "${@}" } # force a branch deletion gbdf() { git \ branch \ --delete \ --force \ "${@}" } # list branches gbl() { git \ branch \ --all \ --list \ --verbose \ --verbose \ "${@}" } # set the link to a remote branch from a local branch git_branch_set_upstream() { git \ branch \ --set-upstream-to \ "${@}" } gbsu() { git_branch_set_upstream "${@}"; } # redo the last commit with a different message git_commit_amend_message() { git \ commit \ --amend \ --message \ "${@}" } gcam() { git_commit_amend_message "${@}"; } # make a root commit git_commit_empty_message() { git \ commit \ --allow-empty \ --allow-empty-message \ --message \ "${@}" } gcem() { git_commit_empty_message "${@}"; } # clean untracked files git_clean_force() { git \ clean \ -d \ --force \ "${@}" } gcf() { git_clean_force "${@}"; } # commit the index git_commit_message() { git \ commit \ --message \ "${@}" } gcm() { git_commit_message "${@}"; } # switch to a branch or checkout file(s) from a commit git_checkout() { git \ checkout \ "${@}" } gc() { git_checkout "${@}"; } # checkout an orphan branch git_checkout_orphan() { git \ checkout \ --orphan \ "${@}" } gco() { git_checkout_orphan "${@}"; } # pick a commit git_cherry_pick() { git \ cherry-pick \ "${@}" } gcp() { git_cherry_pick "${@}"; } # abort the commit pick git_cherry_pick_abort() { git \ cherry-pick \ --abort \ "${@}" } gcpa() { git_cherry_pick_abort "${@}"; } # continue the commit pick git_cherry_pick_continue() { git \ cherry-pick \ --continue \ "${@}" } gcpc() { git_cherry_pick_continue "${@}"; } # configure the user email gcue() { git \ config \ "user.email" \ "${@}" } # configure the user name gcun() { git \ config \ "user.name" \ "${@}" } # differences from last or between commits gd() { git \ diff \ "${@}" } # display what is indexed in cache gdc() { git \ diff \ --cached \ "${@}" } # indexed character-level differences gdcw() { git \ diff \ --cached \ --word-diff-regex "." \ "${@}" } # differences via external tool gdt() { git \ difftool \ --dir-diff \ "${@}" } # character-level differences gdw() { git \ diff \ --word-diff-regex "." \ "${@}" } # fetch from the remote repository gf() { git \ fetch \ --tags \ --verbose \ "${@}" } # fetch from remote repository and prune local orphan branches gfp() { gf \ --prune \ "${@}" } # garbage collect all orphan commits ggc() { git \ reflog \ expire \ --all \ --expire "all" && git \ gc \ --aggressive \ --prune="now" } # initialize a new repository gi() { git \ init \ "${@}" } # initialize a new bare repository gib() { git \ init \ --bare \ "${@}" } # log history gl() { local format="\ %C(auto)%h%d S %C(red)%GS A %C(green)%ai %C(green)%an %ae C %C(blue)%ci %C(blue)%cn %ce %B" git \ log \ --abbrev=8 \ --abbrev-commit \ --format="${format}" \ --graph \ "${@}" } # log all history gla() { gl \ --all \ "${@}" } # log all history with patches glap() { gl \ --all \ --patch \ "${@}" } # log history with patches glp() { gl \ --patch \ "${@}" } # abort the current merge commit gma() { git \ merge \ --abort \ "${@}" } # do a merge commit gmc() { git \ merge \ --no-ff \ --message \ "${@}" } # fast-forward to remote branch gmf() { git \ merge \ --ff-only \ "${@}" } # squash a branch and index its modifications gms() { git \ merge \ --squash \ "${@}" } # merge via external tool gmt() { git \ mergetool \ "${@}" } # push to the remote repository gp() { git \ push \ --tags \ --verbose \ "${@}" } # delete from the remote repository gpd() { git \ push \ --delete \ "${@}" } # force the push to the remote repository gpf() { gp \ --force \ "${@}" } # rebase current branch onto another grb() { git \ rebase \ "${@}" } # abort current rebase grba() { git \ rebase \ --abort \ "${@}" } # continue current rebase grbc() { git \ rebase \ --continue \ "${@}" } # force rebase without fast-forward grbf() { git \ rebase \ --force-rebase \ "${@}" } # rebase interactively grbi() { git \ rebase \ --interactive \ "${@}" } # remove and add removal to index grm() { git \ rm \ "${@}" } # add a new remote repository grma() { git \ remote \ add \ "${@}" } # list remote repositories grml() { git \ remote \ --verbose \ "${@}" } # show connection to a remote repository grms() { git \ remote \ show \ "${@}" } # set the location of a remote repository grmsu() { git \ remote \ set-url \ "${@}" } # remove file(s) from index or move current branch pointer grs() { git \ reset \ "${@}" } # wipe modifications or reset current branch to another commit grsh() { git \ reset \ --hard \ "${@}" } # current state of repository gs() { git \ status \ --untracked-files="all" \ "${@}" } # show a commit gsc() { git \ show \ "${@}" } # tag a commit gt() { git \ tag \ "${@}" } # delete a tag gtd() { git \ tag \ --delete \ "${@}" }