Skip to content

Git Reference Appendix

Source files

  • .chezmoitemplates/aliases/git/git.aliases.sh
  • .chezmoitemplates/aliases/git/signing.aliases.sh

Alias reference

AliasCommand
check-signinggit config --list | grep "gpg\|signing"
cigit commit
enable-signingenable_signing_fn
ggit
gagit add
gaagit add --all
gadgit add .
gaugit add --update
gbgit branch
gbdgit branch -d
gblgit branch -l
gbrgit branch -r
gbrdgit branch -d -r
gbrsbgit show-branch
gbsgit bisect
gcgit commit -a
gcagit commit --amend
gcallgit add -A && git commit -av
gcamgit commit --amend --message
gcanegit commit --amend --no-edit
gcbgit checkout -b
gclgit clone
gcloutgit clean -df && git checkout -- .
gcmgit commit --message
gcogit checkout
gconfdiffgit config alias.dcolor "diff --color-words"
gconflgit config --list
gconfrgit config --local --get remote.origin.url
gdgit diff
gdcachedgit diff --cached
gdchgit diff --name-status
gdhgit diff HEAD
gdis'git checkout --' # changed from checkout to git checkout for safety checking
gdstagedgit diff --staged
gdstatgit diff --stat --ignore-space-change -r
gfgit fetch
gggit grep
gingit init
glgit log --since="last month" --oneline
glcgit log --oneline --reverse
gldgit log --since=1-day-ago
gldcgit log -1 --date-order --format=%cI
gldlgit log --date=local
glfgit log ORIG_HEAD.. --stat --no-merges
glggit log --graph --all --oneline --decorate
glgggit log --oneline --graph --full-history --all --color --decorate
gllgit log --graph --topo-order --date=short --abbrev-commit --decorate --all --boundary --pretty=format:"%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset"
gmvgit mv
gpgit pull
gphgit push
gpogit push origin
gpollgit push origin --all
grgit remote
gragit remote add
grallgit remote | xargs -L1 git push --all
graogit remote add origin
grbgit rebase
grbkgit reset --soft HEAD^
gressgit reset --soft HEAD~1
grevgit revert
grevncgit revert --no-commit
grmgit rm
grmcgit rm --cached
grpagit rev-parse --abbrev-ref HEAD
grsgit restore
grvgit remote -v
gsmgit submodule
gsmagit submodule add
gsmigit submodule init
gsmsgit submodule sync
gsmugit submodule update
gsmuigit submodule update --init
gsmuirgit submodule update --init --recursive
gstgit status
gstagit stash push -m
gstdgit stash drop
gstpgit stash pop
gstsgit status --short
gstsbgit status --short --branch
gswbgit switch
gtpgit rev-parse --show-toplevel
lggit log --graph --oneline --decorate --all
lguilazygit
verify-signaturesgit log --show-signature -n 10

Helper functions

  • gcode()
  • gcom()
  • gpb()
  • grescl()
  • gresh()
  • gresp()
  • undopush()

Validation

  • Run chezmoi apply after alias updates.
  • Run dot doctor to validate your shell state.