Snippets

Useful git aliases

# insert into .gitconfig

[alias]
        co = checkout
        pullff = pull --ff-only
        st = status
        diffs = diff --cached
        upstream = "!f() { git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD); }; f"
        masterpull = "!f() { git checkout master; git pull --ff-only; }; f"
        prune-branches = !git remote prune origin && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -d