Live data from Hacker News

I found a useful Git one liner buried in leaked CIA developer docs

spencer.wtf

201–210 of 273 posts

Re: I found a useful Git one liner buried in leaked CIA developer docs

#201
I sometimes convert old branches to tags. So they don't show up in the list of branches, but I never lose any branches by accident.

All those "merged" workflows only work, if you actually merge the branches. It doesn't work with a squash merge workflow.

edit: I delegate this task to a coding agent. I'm really bad at bash commands. yolo!

Re: I found a useful Git one liner buried in leaked CIA developer docs

#203
What's wrong with just deleting the whole folder and clone repo and whatever branch you're interested in? In any case it's not an urgent thing. You don't have to do this mid-work, you can wait until you push most stuff and then rm && git clone.

The only case in which this wouldn't work is when you have a ton of necessary local branches you can't even push to remote, which is a risk and anti-pattern per se.

Re: I found a useful Git one liner buried in leaked CIA developer docs

#205

What's wrong with just deleting the whole folder and clone repo and whatever branch you're interested in? In any case it's not an urgent thing. You don't have to do this mid-work, you can wait until you push most stuff and then rm && git clone. The only case in which this wouldn't work is when you have a ton of necessary local branches you can't even push to remote, which is a risk and anti-pattern per se.

because of my precious stash? but also the repo is huge, the clone takes 10 minutes? And all the other branches...

Re: I found a useful Git one liner buried in leaked CIA developer docs

#207

I use `master` in all my repos because I've been using it since forever and it never has once occurred to me "oh shit I better change it to `main` this time in case `master` may offend somebody some day. Unfortunately, that's the last thing on my mind when I'm in programming mode. Now that everything is `master`, maybe it is just a simple git command to change it to `main`. But, my fear is it'll subtly break somethin…

[flagged]

[deleted]

Re: I found a useful Git one liner buried in leaked CIA developer docs

#208

What's wrong with just deleting the whole folder and clone repo and whatever branch you're interested in? In any case it's not an urgent thing. You don't have to do this mid-work, you can wait until you push most stuff and then rm && git clone. The only case in which this wouldn't work is when you have a ton of necessary local branches you can't even push to remote, which is a risk and anti-pattern per se.

because of my precious stash? but also the repo is huge, the clone takes 10 minutes? And all the other branches...

> because of my precious stash?

you mean the… pile of shame?

Re: I found a useful Git one liner buried in leaked CIA developer docs

#209

So effectively "I just discovered xargs"? Not to disparage OP but there isn't anything particularly novel here.

It's cool that it comes from CIA, and someone who doesn't know about xargs may just learn something new. What is not to like?

Re: I found a useful Git one liner buried in leaked CIA developer docs

#210
post #2

I 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"?

It's a git repo. What's sort of mess-ups are you worried about that you can't reflog your way out of (or ask claude code to fix)? It's certainly possible to lose uncommitted work, but once it's been committed, unless claude code goes and deletes .git entirely (which I've had codex do, so you'd better push it somewhere), you can't lose work.
Post reply on HN