Skip to content

Instantly share code, notes, and snippets.

@helderberto
Last active June 10, 2019 20:53
Show Gist options
  • Save helderberto/155a47632dafc29b1c97451210a8f021 to your computer and use it in GitHub Desktop.
Save helderberto/155a47632dafc29b1c97451210a8f021 to your computer and use it in GitHub Desktop.
Custom Git Aliases

Custom Git Aliases

Alias

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"

Usage

## List all logs ##
git lg

## Or if you want to see the lines that changed ##
git lg -p

Alias

git config --global alias.st "status"

Usage

## See untracked files ##
git st

Alias

git config --global alias.conflicts "diff --name-only --diff-filter=U"

Usage

## See conflicted files when make a merge ##
git conflicts

Alias

git config --global alias.co checkout

Usage

## Create new branchs or checkout existent
git co -b feature/start

Alias

git config --global alias.br branch

Usage

## Check list of branchs
git br

Alias

git config --global alias.ci commit

Usage

## Commit stagged changes
git ci --m "Add: New files"

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