From 28dbd2d06471f4e6a243cc37f030a9238ab2f086 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 22 Feb 2020 11:21:31 +0100 Subject: [PATCH] Useful Git aliases --- .gitconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitconfig b/.gitconfig index 0a82df2..a7e5a07 100644 --- a/.gitconfig +++ b/.gitconfig @@ -33,6 +33,11 @@ # list aliases la = "!git config -l | grep alias | cut -c 7-" + # git change-commits GIT_COMMITTER_NAME "old name" "new name" + change-commits = "!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; git filter-branch --env-filter \"if [[ \\\"$`echo $VAR`\\\" = '$OLD' ]]; then export $VAR='$NEW'; fi\" $@; }; f " + # from https://help.github.com/articles/remove-sensitive-data + remove-file = "!f() { git filter-branch -f --index-filter \"git rm --cached --ignore-unmatch $1\" --prune-empty --tag-name-filter cat -- --all; }; f" + [push] default = simple