From f5aa4878bd211440eeee7dfd512bcb85e7deca33 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 21 Feb 2025 01:05:50 +0100 Subject: [PATCH] Add git nuke --- modules/cli/tools/git.nix | 5 +++++ modules/cli/zsh/init.zsh | 11 +++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/cli/tools/git.nix b/modules/cli/tools/git.nix index 2bce281..4831596 100644 --- a/modules/cli/tools/git.nix +++ b/modules/cli/tools/git.nix @@ -22,6 +22,11 @@ '' !git branch --merged | grep -vE "^([+*]|\s*($(git master))\s*$)" | xargs git branch --delete 2>/dev/null ''; + nuke = + #bash + '' + !git reset --hard HEAD && git clean -df . + ''; }; extraConfig = { gpg.format = "ssh"; diff --git a/modules/cli/zsh/init.zsh b/modules/cli/zsh/init.zsh index 7bddf81..d56971c 100644 --- a/modules/cli/zsh/init.zsh +++ b/modules/cli/zsh/init.zsh @@ -92,11 +92,6 @@ push() { git add -A && git commit -m "$*" && git push } -git-branch-clear() { - git fetch --prune origin - git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D -} - nixify() { if [ ! -e ./.envrc ]; then echo "use nix" > .envrc @@ -105,9 +100,9 @@ nixify() { cat > shell.nix <<'EOF' {pkgs ? import {}}: pkgs.mkShell { - packages = with pkgs; [ - - ]; + packages = with pkgs; [ + + ]; } EOF fi