function Remove-GitBranches {
git branch --merged | Out-GridView -Title "Branches to Remove?" -OutputMode Multiple | % { git branch -d $_.Trim() }
}
`Out-GridView` gives you a quick popup dialog with all the branch names that supports easy multi-select. That way you get a quick preview of what you are cleaning up and can skip work in progress branch names that you haven't committed anything to yet.I found a useful Git one liner buried in leaked CIA developer docs
101–110 of 273 posts
Re: I found a useful Git one liner buried in leaked CIA developer docs
#102Earlier quoted context omitted.
Sorry, but this 65 yo grey-beard disagrees. A TUI to me, back in the 80s/90s, was something that ran in the terminal and was almost always ncurses-based. This was back when I was still using ADM-3A serial terminals, none of that new-fangled PCs stuff.
We might've been caught on different parts of the wave. I checked Ngrams out of curiosity https://books.google.com/ngrams/graph?content=TUI&year_start... Basically it was never used, then it was heavily used, and then never used, and then in the early 00s it took off again. That'd explain why you used it, I never did, and now young kids are.
It's not a term I recall hearing at all when I started using computers in the mid-'80s - all that mattered back then was "shiny new GUI, or the clunky old thing?" I really thought it was a retroneologism when I first heard it, maybe twenty years ago.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#103So effectively "I just discovered xargs"? Not to disparage OP but there isn't anything particularly novel here.
This feels like gatekeeping someone sharing something cool they've recently learned. I personally lean more towards the "let's share cool little productivity tips and tricks with one another" instead of the "in order to share this you have to meet [entirely arbitrary line of novelty/cleverness/originality]." But each to their own I suppose. I wonder how you learned about using xargs? Maybe a blog-post or article not…
Re: I found a useful Git one liner buried in leaked CIA developer docs
#104Earlier quoted context omitted.
The amount of little tools I'm creating for myself is incredible, 4.6 seems like it can properly one/two shot it now without my attention. Did you open source that one? I was thinking of this exact same thing but wanted to think a little about how to share deps, i.e. if I do quick worktree to try a branch I don't wanna npm i that takes forever. Also, if you share it with me, there's obviously no expectations, even it…
What's the point of open sourcing something you one shot with an LLM? At that point just open source the prompt you used to generate it.
That said, I do think it would be awesome if including prompts/history in the repos somehow became a thing. Not only would it help people learn and improve, but it would allow tweaking.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#105I don't delete branches, I just work with the top several most recently modified.
How to list those? Is there a flag for git branch to sort by recently modified? (not on my computer right now to check)
Re: I found a useful Git one liner buried in leaked CIA developer docs
#106Earlier quoted context omitted.
The amount of little tools I'm creating for myself is incredible, 4.6 seems like it can properly one/two shot it now without my attention. Did you open source that one? I was thinking of this exact same thing but wanted to think a little about how to share deps, i.e. if I do quick worktree to try a branch I don't wanna npm i that takes forever. Also, if you share it with me, there's obviously no expectations, even it…
What's the point of open sourcing something you one shot with an LLM? At that point just open source the prompt you used to generate it.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#107Re: I found a useful Git one liner buried in leaked CIA developer docs
#108 DEFAULT_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
git branch --merged "origin/$DEFAULT_BRANCH" \
| grep -vE "^\s*(\*|$DEFAULT_BRANCH)" \
| xargs -r -n 1 git branch -d
This is the version I'd want in my $EMPLOYER's codebase that has a mix of default branchesRe: I found a useful Git one liner buried in leaked CIA developer docs
#109I currently have a TUI addiction. Each time I want something to be easier, I open claude-code and ask for a TUI. Now I have a git worktree manager where I can add/rebase/delete. As TUI library I use Textual which claude handles quite well, especially as it can test-run quite some Python code.
how do you trust the code claude wrote? don't you get anxiety "what if there's an error in tui code and it would mess up my git repo"?
Re: I found a useful Git one liner buried in leaked CIA developer docs
#110Anyone else "vibe git-ing” lately? I just ask Claude Opus to clean it up and it does really well. Same for build commands and test harnesses.
I have replaced my standard ddg of, "git " with asking Claude to give me the commands I need to run.