Add a command to clean git repos

This commit is contained in:
Andreas Zweili 2022-07-12 10:05:09 +02:00
parent b6e73b9eca
commit 8833a22f6f
1 changed files with 7 additions and 0 deletions

View File

@ -110,4 +110,11 @@
};
# raw files
home.file.".config/git/hooks".source = ./hooks;
home.shellAliases = {
git-clean = ''
git fetch --all -p;
git branch --merged origin/master | grep -v "\*" | xargs git branch -d;
git branch -vv | grep -v '\[origin/'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branh -D;
'';
};
}