๐Ÿš€ Clean Up Your Local Git Branches! ๐Ÿงน | Temuri Takalandze

Image description

Over time, local branches pile up, especially after merging or deleting them remotely. To remove local branches that no longer have a remote counterpart, follow these simple steps:

1️⃣ List branches that are gone from the remote:
๐Ÿ‘‰ git branch -vv | awk '/: gone]/{print $1}'

3️⃣ Delete them:
๐Ÿ‘‰ git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d

⚠️ If Git complains that a branch is not fully merged, use -D instead of -d, but be careful! ๐Ÿšจ

Keep your workspace clean & organized! ✅

Post a Comment

0 Comments