Did you clone a large amount of git repos? Is ~/workspace/ a giant mess? Need to declutter?

If a remote exists and all branches have been pushed (or merged), and you trust the git host to stay up, maybe we don't need to keep the local copy.

Or if there's local branch refs for commits that have never been pushed, maybe they should be.

https://github.com/ellieayla/git-unneeded will report whether deleting branches/repo would be safe. Doesn't delete anything for you.

#git #github #tools #devtools

find ~/workspace -maxdepth 2 -name .git -type d -print0 | xargs -0 git unneeded --no-fetch

aaaaaaaaaaaaa

#dead #git

@ellie 😅 not exactly this but I wrote a script for work to list all the outdated branches for me and a parameter to remove them. I .. tend to create a lot of branches it seems

@ellie sweet 👍 I can use this

Also it's nice to see the recommendation to install with uv or pipx, not plain pip... That has been disappointingly slow (IMO) to catch on

@diazona @ellie what is wrong with pip?

@sunray @ellie It's not really a problem with pip itself, the problem is people blindly running `pip install` (or worse, `sudo pip install` on Unix-like systems) without using a virtual environment, which winds up installing packages into their one "global" Python environment. If you do that, sooner or later you run into conflicting versions of dependencies, and in some cases it can break your system. pipx and similar tools solve that by automatically creating a fresh virtual environment for every program you install with them.

#Python

@diazona @ellie Very cool to know - thanks!