I found a useful Git one liner buried in leaked CIA developer docs
1–10 of 273 posts
Re: I found a useful Git one liner buried in leaked CIA developer docs
#2I 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.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#3The git plugin in oh-my-zsh has an alias for this: gbda
It also has one for squash-merged branches: gbds
Very useful I've been using them for years
Re: I found a useful Git one liner buried in leaked CIA developer docs
#4So effectively "I just discovered xargs"? Not to disparage OP but there isn't anything particularly novel here.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#5[deleted]
Re: I found a useful Git one liner buried in leaked CIA developer docs
#6If you are using Fork.app on Mac as your git client, this now exists (For one month now) there too: https://github.com/fork-dev/Tracker/issues/2200#issuecomment...
Re: I found a useful Git one liner buried in leaked CIA developer docs
#7I've had this command as 'git drop-merged' for a few years now (put as a script in your path named git-drop-merged:
#!/bin/sh
git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs --no-run-if-empty
git branch -dRe: I found a useful Git one liner buried in leaked CIA developer docs
#8The git plugin in oh-my-zsh has an alias for this: gbda It also has one for squash-merged branches: gbds Very useful I've been using them for years
That's handy! I just started using oh-my-zsh and I feel like I know about 4% of useful things it can do so far.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#9I 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.
That sounds like a complete waste of time and tokens to me, what is the benefit? So each time you do something, you let Claude one shot a tui? This seems like a waste of compute and your time
Re: I found a useful Git one liner buried in leaked CIA developer docs
#10I use
#!/bin/sh
git checkout main
git fetch --prune
git branch | grep -v main | xargs --no-run-if-empty git branch -D
git pull
Save that next to your git binary, call it whatever you want. It's destructive on purpose.