Skip to content

Instantly share code, notes, and snippets.

@leonardoraele
Last active February 12, 2025 23:16
Show Gist options
  • Select an option

  • Save leonardoraele/5a3c5fbe4163a04077b81e357a6d7598 to your computer and use it in GitHub Desktop.

Select an option

Save leonardoraele/5a3c5fbe4163a04077b81e357a6d7598 to your computer and use it in GitHub Desktop.
My Personal Git Aliases
# Navigation
alias ll="ls -lhaFGOo"
# Git - Safe
alias ga='git add'
alias gaa='git add --all'
alias gb='git branch'
alias gc='git checkout'
alias gd='LESS=R git diff'
alias gf='git fetch'
alias gp='git pull'
alias gl='LESS=R git log'
alias gll='LESS=R git log --graph --oneline --decorate'
alias gs='git status'
alias gmaster='git checkout origin/master --detach'
alias gmain='git checkout origin/main --detach'
alias gdev='git checkout origin/dev --detach'
# Git - Dangerous
alias gclear='git checkout --detach && git branch | grep -v \* | xargs git branch -D'
alias gwrap="git add --all && echo ':wq' | git commit --amend"
alias gwrapp="gwrap && git push -f"
alias gpush="git push 2> ~/.temp || cat ~/.temp | grep 'git push' | sh"
alias gpushf="git push -f 2> ~/.temp || cat ~/.temp | grep 'git push' | sh"
alias grebase='git add --all && git stash && git pull --rebase && git stash pop && git reset'
# ZSH shell prompt line
# Doc at http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html
PS1="%(?.%F{green}√.%F{red}x)%f %* %B%~$%b "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment