Skip to content

Instantly share code, notes, and snippets.

@ieschalier
Last active April 12, 2024 07:53
Show Gist options
  • Save ieschalier/28dc3161a79efca9112e89abfb845529 to your computer and use it in GitHub Desktop.
Save ieschalier/28dc3161a79efca9112e89abfb845529 to your computer and use it in GitHub Desktop.
git
[user]
#
[alias]
co = checkout
br = branch
sts = status --short
last-log = log -5 --pretty --oneline
who = shortlog -sn
graph = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
pretty-graph = log --all --graph --decorate --oneline --simplify-by-decoration
add-c = !git add -A && git commit
clean-merged = "!git co main && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
recreate = "!f() { [[ -n $@ ]] && git checkout \"$@\" && git unpublish && git checkout master && git branch -D \"$@\" && git checkout -b \"$@\" && git publish; }; f"
remove-last = reset --hard HEAD~1
week-commit = "!git whatchanged --since='1 weeks ago'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment