Live data from Hacker News

Oh Shit, Git?

ohshitgit.com

21–30 of 275 posts

Re: Oh Shit, Git?

#21
post #14

Earlier quoted context omitted.

Possibly consider that "deleting a file from history" is rather far outside the norm or recommended practice for git (even though it is, of course, entirely possible)

> even though it is, of course, entirely possible I take the more realistic perspective: until git makes it impossible to commit something that shouldn't have been, like a secret, then deleting a file from history is a fundamental requirement of git.

The designers of git clearly disagreed, as you can guess from its design, so it's not surprising it might feel like a bit of an uphill struggle (and will probably remain so). There are other tools available.

Re: Oh Shit, Git?

#22
post #4

Git is one of those technologies that I never got to wrap my head around of, because in so many ways it doesn't follow intuition and unless you have been using it for a long time, for literally every action you would probably have to Google or use the man page of the command.

It's ok mate. Hackernews says we should be using jj to manage our rewritten-in-Rust code.

Re: Oh Shit, Git?

#23

Earlier quoted context omitted.

Bro, really, self-taught people with a bare minimum understanding of the tools they use are super normal, and when they get into a pit they have to fix it themselves. Although to your point folks would be better served carefully reading the docs / git book than googling a specific solution to their specific error code.

[flagged]

I guess we're coming from different places. In my vernacular, ending a comment with "...really?" is about as casual as calling somebody bro.

It's gender neutral btw.

Re: Oh Shit, Git?

#24
post #22
post #4

Git is one of those technologies that I never got to wrap my head around of, because in so many ways it doesn't follow intuition and unless you have been using it for a long time, for literally every action you would probably have to Google or use the man page of the command.

It's ok mate. Hackernews says we should be using jj to manage our rewritten-in-Rust code.

Haha, I'm so glad I didn't fall for the whole rust thing.

Re: Oh Shit, Git?

#25

Earlier quoted context omitted.

I've been using git for at least 6 years now, maybe 10. Sites like this are a great aid to remembering how to deal with certain situations. And yes, I understand what the commands do, but that doesn't mean I always could, or always want to, put together the series of steps from scratch. And also, we self-host our own gitea hosting because we're not getting sucked down by yet another hosting debacle (old enough to hav…

> For git hosting just as much as everything else on line, if you're not paying for it, you're not the customer. Yeah, lovely trope, but I'm literally talking about organizations hosting their Git repos on a file share here.

Why would you ask employees of a file hosting service about how to use git?

Re: Oh Shit, Git?

#26

Yeah, please don't create sites like this. Just... don't. Any, and I mean any "in case of a Git problem, just do this " recipe is wrong , often in very subtle ways. So, my advice: in case of a Git problem, contact the help channel provided by the organization hosting your Git repository. They'll help you out! And if it's your personal-I-am-truly-the-only-human-using-this repository? Just recreate it, and save yoursel…

Recipes like these aren't useless, but yes, they really need to be prefixed with whether they expect to start from a clean work tree and empty staging area. Or describe what they'll do to uncommitted changes, both staged & unstaged. Otherwise they pose a substantial risk of making the problem worse.

Re: Oh Shit, Git?

#28
post #22
post #4

Git is one of those technologies that I never got to wrap my head around of, because in so many ways it doesn't follow intuition and unless you have been using it for a long time, for literally every action you would probably have to Google or use the man page of the command.

It's ok mate. Hackernews says we should be using jj to manage our rewritten-in-Rust code.

Since you brought it up, I personally switched to jujutsu and prefer it greatly. I regularly help coworkers deal with issues in git and keep dropping hints like `in jujutsu this would've been done way easier like this!`. Nobody bites yet since I think most of them don't want to use the CLI but maybe someday if enough people keep talking about it the inertia will get to the point that we can get some really slick GUIs for jj.

Re: Oh Shit, Git?

#29
post #3

Some changes I would make: 1. Always use `git switch` instead of `git checkout` 2. Avoid `reset --hard` at all costs. So for the "accidentally committed something to master that should have been on a brand new branch" issue, I would do this instead: # create a new branch from the current state of master git branch some-new-branch-name # switch to the previous commit git switch -d HEAD~ # overwrite master branch to th…

The disconnect between git's beautiful internal model of blobs, a tree of commits, and pointers to commits, and the command line interface is so wild. All of these recipes are unintuitive even if you have a firm grasp of git's model; you also need to know the quirks of the commands! To just look at the first one... wouldn't it be more intuitive for the command line interface to be:

    # this command exists already;
    $ git switch -c some-new-branch-name
    # is there a command that simply moves a branch from one commit to another without changing anything else? It feels like it should be possible given how git works.
    $ git move-branch master HEAD~

Re: Oh Shit, Git?

#30

Earlier quoted context omitted.

[flagged]

I guess we're coming from different places. In my vernacular, ending a comment with "...really?" is about as casual as calling somebody bro. It's gender neutral btw.

"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.
Post reply on HN