git branch --merged origin/main --format="%(refname:short)" \ | grep -vE "^(main|develop)$" \ | xargs -r git branch -d
that said... pretty hilarious a dev was just like "uhh yeah ciaclean..." curious what... other aliases they might have??I found a useful Git one liner buried in leaked CIA developer docs
111–120 of 273 posts
Re: I found a useful Git one liner buried in leaked CIA developer docs
#112https://github.com/henrikpersson/git-trash
I use this script with a quick overview to prevent accidentally deleting something important
Re: I found a useful Git one liner buried in leaked CIA developer docs
#113I see that even the CIA, a federal government office, has not fully used DEI approved, inclusive language yet :-)
Re: I found a useful Git one liner buried in leaked CIA developer docs
#114Earlier quoted context omitted.
Eg: lazygit https://github.com/jesseduffield/lazygit?tab=readme-ov-file#... https://github.com/sxyazi/yazi https://github.com/darrenburns/posting or I guess Vim would be a prominent example. Peoples definitions will be on a gradient, but its somewhere between CLI (type into a terminal to use) and GUI (use your mouse in a windowing system), TUI runs in your terminal like a CLI but probably supports "graphical widgets"…
So the acronym is for Terrible User Interface? ;)
Re: I found a useful Git one liner buried in leaked CIA developer docs
#115Earlier 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…
The deps question is huge, let me know if you solve it.
Re: I found a useful Git one liner buried in leaked CIA developer docs
#116I have a cleanup command that integrates with fzf. It pre selects every merged branch, so I can just hit return to delete them all. But it gives me the opportunity to deselect to preserve any branches if I want. It also prunes any remote branches # remove merged branches (local and remote) cleanup = "!git branch -vv | grep ': gone]' | awk '{print $1}' | fzf --multi --sync --bind start:select-all | xargs git branch -D…
$(git config user.primaryBranch)
What about using git's own `init.defaultBranch`?I mean, while useless in terms of `git init` because the repo's already init'd, this works:
git config --local init.defaultBranch main
And if you have `init.defaultBranch` set up already globally for `git init` then it all just worksRe: I found a useful Git one liner buried in leaked CIA developer docs
#117Re: I found a useful Git one liner buried in leaked CIA developer docs
#118I have a cleanup command that integrates with fzf. It pre selects every merged branch, so I can just hit return to delete them all. But it gives me the opportunity to deselect to preserve any branches if I want. It also prunes any remote branches # remove merged branches (local and remote) cleanup = "!git branch -vv | grep ': gone]' | awk '{print $1}' | fzf --multi --sync --bind start:select-all | xargs git branch -D…
git switch my-test-branch
...
git pull origin main:main
git rebase mainRe: I found a useful Git one liner buried in leaked CIA developer docs
#119> Since most projects now use main instead of master… I see that even the CIA, a federal government office, has not fully used DEI approved, inclusive language yet :-)