Command lineeasyGit

Git Aliases Setup

Create useful Git aliases for faster workflow and common operations.

01

The problem

You want to speed up your Git workflow with shorter commands.

02

The solution

Git
# Add these to ~/.gitconfig or run individually

# Status shortcuts
git config --global alias.s "status -sb"
git config --global alias.ss "status"

# Commit shortcuts
git config --global alias.c "commit"
git config --global alias.cm "commit -m"
git config --global alias.ca "commit --amend"
git config --global alias.cane "commit --amend --no-edit"

# Log formatting
git config --global alias.lg "log --graph --pretty=format:'%C(auto)%h%d %s %C(cyan)(%cr) %C(bold blue)<%an>%Creset'"
git config --global alias.ll "log --oneline -n 20"

# Branch operations
git config --global alias.br "branch"
git config --global alias.co "checkout"
git config --global alias.cob "checkout -b"

# Staging
git config --global alias.a "add"
git config --global alias.aa "add ."
git config --global alias.ap "add -p"

# Push/pull
git config --global alias.p "push"
git config --global alias.pl "pull"
git config --global alias.pu "push -u origin HEAD"

03

Put it to work

Example
# After setup:
git s          # Short status
git cm "fix: update config"  # Commit with message
git lg         # Pretty log graph
git cob feature/new-login    # Create and checkout branch

Worth knowing

Aliases are stored in ~/.gitconfig. Create shell aliases for even shorter commands.