Skip to content

Instantly share code, notes, and snippets.

@saulopaiva
Last active April 13, 2024 17:14
Show Gist options
  • Save saulopaiva/e3768c372fed914da09d359851be0f01 to your computer and use it in GitHub Desktop.
Save saulopaiva/e3768c372fed914da09d359851be0f01 to your computer and use it in GitHub Desktop.
----------------------------------------------
> Show Conflits:
git config --global alias.conflicts "diff --name-only --diff-filter=U"
Use: git conflicts
----------------------------------------------
> Log
git config --global alias.l "log -n 20 --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
Use: git l
----------------------------------------------
> Status
git config --global alias.st "status"
Use: git st
----------------------------------------------
> Add
git config --global alias.a "add --all"
Use: git a
----------------------------------------------
> Add and commit
git config --global alias.ac '!git add -A && git commit'
Use: git ac
----------------------------------------------
> Files modified on commit
git config --global alias.filesofcommit "!sh -c 'git show --stat --oneline $1' -"
Use: git filesofcommit HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment