Git Aliases That Boost Your Coding Speed By 10x
Discover powerful Git aliases that transform your workflow. Save time, reduce keystrokes, and code faster with these shortcuts.
• 4 minutes read
Discover powerful Git aliases that transform your workflow. Save time, reduce keystrokes, and code faster with these shortcuts.
• 4 minutes read
git add . && git commit -m "message"
git push origin main
alias ga='git add' alias gcm='git commit -m' alias gps='git push' alias gst='git status' alias gl='git log --oneline --graph --decorate'
source ~/.zshrc
ga . && gcm "Initial commit"
# ===================================== # 🧩 Some Important Git Command Aliases # ===================================== # --- Basic Commands --- alias gi='git init' # Creates an empty Git repository alias ga='git add' # Quickly add files alias gst='git status' # Check repo status alias gd='git diff' # Show diffs alias gdf='git diff --name-only' # Show changed file names only alias gb='git branch' # List branches alias gco='git checkout' # Switch branches alias gcob='git checkout -b' # Create and switch to a new branch # --- Commit & Push --- alias gcm='git commit -m' # Commit with a message alias gcam='git commit -am' # Add and commit all changes alias gca='git commit --amend' # Amend last commit alias gpl='git pull' # Pull latest changes alias gps='git push' # Push current branch alias gpsh='git push origin HEAD' # Push current HEAD branch alias git-undo='git reset --soft HEAD~1' # Undo the last commit but keep all file changes staged (useful when you commit on the wrong branch) # --- Logs & History --- alias gl='git log' # Log view alias glo='git log --oneline --graph --decorate' # Pretty log view alias glp='git log -p' # Log with patches # --- Rebasing & Stashing --- alias grb='git rebase' # Start a rebase alias grbc='git rebase --continue' # Continue rebase alias grba='git rebase --abort' # Abort rebase alias gsta='git stash push -m' # Stash with message alias gstp='git stash pop' # Apply last stash # --- Cloning --- alias gcl='git clone' # Clone repos quickly
source ~/.zshrc
💌 Don’t miss out! Join my newsletter for web development tips, tutorials, and insights delivered straight to your inbox.
Thanks for reading & Happy coding! 🚀