Skip to content

Instantly share code, notes, and snippets.

@matheusnascgomes
Last active May 23, 2023 12:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matheusnascgomes/e6c7ff55a4728eb7daaefa0964afdcc2 to your computer and use it in GitHub Desktop.
Save matheusnascgomes/e6c7ff55a4728eb7daaefa0964afdcc2 to your computer and use it in GitHub Desktop.
Usefull git alias
[alias]
st = status
        co = commit
        logone = log --oneline
        lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
        ck = checkout
        copy = checkout -b
        br = branch
        mr = merge
        brdel = branch -D
        com = commit -m
        csn = commit -sm
        brclear = !git branch | grep -v 'master\\|development\\|staging' | xargs git branch -D
        go-ahead = merge --continue
        skip-rebase = rebase --skip
        incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
        outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
        rollback = reset --soft HEAD~1
        edit = !git config --global --edit
        pushit = push origin HEAD
        pullit = pull origin HEAD        
@matheusnascgomes
Copy link
Author

Clear useless branches
git branch | grep -v "master\|development\|staging" | xargs git branch -D

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