Top
Best
New

Posted by spencerldixon 13 hours ago

I found a useful Git one liner buried in leaked CIA developer docs(spencer.wtf)
602 points | 214 commentspage 4
kazinator 8 hours ago|
Or don't go crazy making branches in the first place.

Have a merge workflow which deletes the branch right there.

jimnotgym 11 hours ago||
I have an image of running his command, 'ciaclean', and a black van turnes up with a bunch of agents in coveralls, brandishing rolls of polyethylene sheeting and drums of acid.
WorldMaker 11 hours ago||
I use this PowerShell variant:

    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.
cowlby 11 hours ago||
Anyone 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.
mywittyname 11 hours ago|
It does a pretty good job, but I still don't completely trust it with keys to the kingdom.

I have replaced my standard ddg of, "git <the thing i need>" with asking Claude to give me the commands I need to run.

taude 12 hours ago||
I've had this in my ~/.bash_aliases for awhile:

  alias git-wipe-merged-branches='git branch --merged | grep -v \* | xargs git branch -D'
Trying to remember where I got that one, as I had commented the following version out:

  alias git-wipe-all-branches='git for-each-ref --format '%(refname:short)' refs/heads | grep -v master | xargs git branch -D'
tonmoy 8 hours ago||
I’m surprised to see not enough people using xargs, or maybe I overuse it
woodpanel 2 hours ago||
I’ve been doing just `git branch -d $(git branch)`, what am I missing?
Sesse__ 12 hours ago||
You probably want git-dmb (dmb = delete merged branches) for a safe and more comprehensive way of dealing with this.
puzz 12 hours ago|
Or git-old-branches/git-recent from git-plus

https://github.com/tkrajina/git-plus

Disclaimer, I'm the author ^^

dewey 13 hours ago||
If 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...
stabbles 12 hours ago|
Missed opportunity to call it `git ciao`
More comments...