From 7521b01073063c873ef49eeb85b74d3cd2b178b9 Mon Sep 17 00:00:00 2001 From: nkoji21 <133028205+nkoji21@users.noreply.github.com> Date: Sat, 30 May 2026 09:52:16 +0900 Subject: [PATCH] =?UTF-8?q?fix(git):=20worktree=E4=B8=8A=E3=81=AEgone?= =?UTF-8?q?=E3=83=96=E3=83=A9=E3=83=B3=E3=83=81=E3=82=82=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E3=81=AB=E6=8E=83=E9=99=A4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- .gitconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitconfig b/.gitconfig index 37450a1..372f4b5 100644 --- a/.gitconfig +++ b/.gitconfig @@ -9,7 +9,7 @@ save = stash save -u # メッセージ付きstash untrackedファイル含 see = !gh repo view --web # 該当リポジトリを開く la = log --oneline --decorate --graph --branches --tags --remotes --all - gone = "!git branch -vv | grep ': gone]' | awk '{print $1}' | xargs -r git branch -D" + gone = "!f() { current=$(git rev-parse --show-toplevel); git for-each-ref --format='%(refname:short)%09%(upstream:track)%09%(worktreepath)' refs/heads | while IFS=' ' read -r branch track worktree; do [ \"$track\" = '[gone]' ] || continue; if [ -n \"$worktree\" ]; then if [ \"$worktree\" = \"$current\" ]; then echo \"Skipping current worktree: $branch ($worktree)\" >&2; continue; fi; git worktree remove \"$worktree\" || continue; fi; git branch -D \"$branch\"; done; }; f" aliases = !git config --get-regexp alias | sed 's/^alias.//g' | sed 's/ / = /1' [fetch]