by antithesis-nl · 1y ago · 0 comments
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 yourself the pain.
Source: I'm part of the team behind the #githelp channel in many $DAYJOBs, and we know how hard things are. You committed an unencrypted password file, or worse, your entire 'secret' MP4 collection to our monorepo? Sure, just let us know! Pushed your experimental branch to master/main/head/whatever? We'll fix it!
Just don't ever, for whatever reason, run that-chain-of-commands you found on the Internet, without understanding what they do! In most cases, your initial mistake can be undone pretty quickly (despite requiring nonstandard tooling), but once you're three levels deep and four days later, not so much...
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 have suffered under sourceforge, and don't plan on getting in the same situation again). 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.
And, by the time a '#githelp team' is formed, it's to address patterns to which there are known solutions.
One of the many problems with Git, is that these solutions depend very, very much on the structure of the repo and the common practices of its users.
So, instead of executing random commands from the Internet, just ask. Please! Or, if there's truly nobody going to be around, give in and recreate the repo. You'll save yourself so much pain in the long run...
I'm the resident git expert, but not by choice. There's more that I don't know than that I do. It's not uncommon that I need to use internet recipes to un-wedge someone's clone.
> Or, if there's truly nobody going to be around, give in and recreate the repo. You'll save yourself so much pain in the long run...
This is insane. There are a dozen other people using the remote, not to mention a whole CI/CD build configuration.
I applaud you for your honesty, but... Really?
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.
Oh no, that poor soul...