DEV Community

Discussion on: My Personal Git Tricks Cheatsheet

Collapse
 
iamandrewluca profile image
Andrei Luca • Edited

Git aliases

# ~/.gitconfig
[alias]
    spull = "!git stash && git pull --rebase && git stash pop"
    spush = "!git stash && git pull --rebase && git push && git stash pop"
    pushf = push --force-with-lease
    ameno = commit --amend --no-edit
    anarchy = "!git add . && git ameno && git pushf"

System aliases

# ~/.bashrc, ~/.zshrc, ...
alias cdg='cd $(git rev-parse --show-toplevel)'