Skip to content

Instantly share code, notes, and snippets.

@keckelt
Created February 24, 2025 20:03
Show Gist options
  • Save keckelt/cdaabc6db1df2218f10f6302b33dbaa5 to your computer and use it in GitHub Desktop.
Save keckelt/cdaabc6db1df2218f10f6302b33dbaa5 to your computer and use it in GitHub Desktop.
Git aliases

Git Aliases

Show current aliases

 git config --get-regexp alias

Status

Shortcut to git status to git st.

Confgiure with

git config --global alias.st status

Push and create remote branch

Configure with:

git config --global alias.pushup "push --set-upstream origin develop"

use with: git pushup 💪

Show last commits on this branch

Excludes commits to other branches that were merged in the current

Configure with:

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --first-parent"

use with: git lg

Show last commits to this branch

Also shows commits merged into this branch

Configure with:

git config --global alias.lga log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

use with: git lga

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment