Live data from Hacker News

Oh Shit, Git?

ohshitgit.com

81–90 of 275 posts

Re: Oh Shit, Git?

#81

I'm not proud of it, but my #1 "Oh shit" git operation is to just delete my local repo, reclone, and reapply the changes. Works really well for me 95% of the time. The rest I ask dev ops guy to help.

This should be a built-in

  git unshit
Or

  git add --unshit -f ~HEAD^^
If you’re using git version <= 2.844.

Re: Oh Shit, Git?

#82
post #30

Earlier quoted context omitted.

"Bro" is the furthest thing from "gender neutral". Not sure how you could think it's gender neutral. It originated from male behavior and is definitely not gender neutral. You can address women as "bro" and they might even respond to you but they'll think you're absolutely weird.

No, the female and non-binary people in my life both give and accept "bro" or "bruh" without complaint. I once asked one of my non-binary friends directly how they felt about "bro", "dude", etc and they consider those words to be gender neutral. They are like the word "man" now ("IDK man").

> They are like the word "man" now ("IDK man").

That's actually how it was originally, because in Old English "man" just meant a gender-neutral "person."

Gendered versions were "wer" and "wif", so you could have a "wer-man" and a "wif-man", the latter changing pronunciation to become "woman". I suppose this also means that there are both "werewolves" and "wifwolves".

Re: Oh Shit, Git?

#83

We should start recommending UIs as the default way to learn Git. It would solve a third of these problems and another third wouldn't even come up. If you later decide that the CLI is faster, go ahead. But first, people need to see visually how they can interact with the tree. I like fork.dev, but most clients are pretty similar at this point.

The cli is faster if you know by heart but a real disadvantage is that it is hard to "see" what you did or what happened in the past. Good look finding where/whether an old branch got merged and find out if it is part of a release, using cli.

Re: Oh Shit, Git?

#84

My hot take is that Git isn't nearly as hard as the endless blogs pretend.

"hard"? it is not hard, it is just poorly designed, the API (commands) are really terrible.

Think of it: one person who cares about UX decades ago could make git 10 times more sane for milions of devs.

Re: Oh Shit, Git?

#87
The one thing I wish people would internalise about git is it's an append only data store. To get work into the store, you commit it. Once in the store there is not a command in git that can remove it.

This is how the reflog works. Whatever you do, you can get back to a previous branch state and restore the work from the data store.

But git can't help you if you don't commit. So just commit. Commit all the time. If you think it's too much overhead and you always forget to commit, fix your tools. If you're writing code all day you should be committing at a minimum every hour, in general.

Re: Oh Shit, Git?

#88

Is this related to "Oh Shit, git?" by Julia Evans? https://wizardzines.com/zines/oh-shit-git/ Perhaps not and the authors just named it the same because it rolls off the tongue nicely.

Yes! Katie and I made it into a zine because I was such a huge fan of her work on https://ohshitgit.com/. (you'll notice she's a coauthor of the zine)

Re: Oh Shit, Git?

#89
This will feel very weird in April 2025, when we celebrate the 20th anniversary of git.

I was there. And at some point I wondered if I should learn git, darcs, or bazaar, to replace SVN or CVS. Or did I try mercurial too ?

I wonder if the "GitHub" effect has basically killed the need for a newcomer in the space of VCS. Maybe at some point, the yak is shaved enough ?

Re: Oh Shit, Git?

#90

I'm not a git user, but stuff like this really drives home the idea that "git commit" is meaningless, the only thing that matters is when your commits are pushed or merged. It's like saving a textfile. Do you write a little message every time you save a file? No that's silly. Just move on.

Commit is what causes git to make a copy of the file(s) internally. It's vitally important. But there is no point typing in silly messages like "more fixes" etc. What I do is make an initial commit with something like "(WIP) too feature", then keep doing amend commits until I'm happy, at which point I remove the "(WIP)" from the message.
Post reply on HN