Live data from Hacker News

Oh shit, git: Getting myself out of bad situations

ohshitgit.com

281–290 of 520 posts

Re: Oh shit, git: Getting myself out of bad situations

#281

Earlier quoted context omitted.

* Your attitude is the exact opposite. * You setting your theory against my lived experience. If you want to understand the situation more fully, you can read How To Destroy A Tech Startup In Three Easy Steps: https://www.amazon.com/Destroy-Tech-Startup-Easy-Steps/dp/09... I did my best to re-create the extent to which decisions were driven by panic and the pressure of time. Please note, every company in the world ha…

Well, I see you're adding more and more constraints to suit your point of view. First you attacked git by pointing out some flaws that were only just about people not knowing how it worked. Then you gave a more specific example, where actually, it was in the company's best interest to hire a novice developer who didn't have time to learn git, because he was pressured into focusing on whatever the CEO wanted. Then you…

You don't give a reason for this:

But please don't teach them SVN

Why would you say this?

You also say:

If the company hires lower skill people, you can just guide choose a branching mode suited for their needs

If the company has lower skill people, why not go with the technology that requires less skill? This seems like an obvious step.

Re: Oh shit, git: Getting myself out of bad situations

#282
post #123

Adopted a git GUI years ago and haven't looked back. I get looks sometimes, but I can't help but gloat when I can stage and unstage individual lines in less than a second. I think anyone who uses the CLI is either trying too hard or hasn't realized the beauty of a git GUI. Takeaways: - My commit time is usually much faster than coworkers, with higher accuracy (less frequent accidental commits, etc.) - I don't remembe…

I use the git CLI. I do it for one reason. I know exactly what i'm doing on it. I have nothing to prove to anyone, I'm not trying to impress anyone with my "hacker" skillz. When I've tried GUI's, I'm not 100% sure what's going on under the covers. Sometimes they try to obfuscate things. While I'm probably not the worlds most advanced user, I know enough to know what I want to do, and how to do it. The CLI let's me do…

I like fugitive - it feels like cli git without having to leave the editor. GAdd adds the currently file/selected lines, GBlame pulls up git blame information the ability to reblame, GStatus show the status with the ability to jump to/stage/unstage files and so on. Tried Magit for a while but it didn't play nice with evil.

Still hoping for a git repl that just does graph queries/transformations though.

Re: Oh shit, git: Getting myself out of bad situations

#283
post #71

Earlier quoted context omitted.

What GUI do you recommend? My experience has been that GUIs are the easiest and fastest way to make a mess that can't be corrected without dropping to CLI or re-cloning. (I'm looking at you SourceTree). I've long recommended that everyone who uses git know how to use the CLI even if they don't use it regularly.

If you're on a mac, I can't recommend Tower enough. It's a paid app but well worth the money. Otherwise Git Kraken is a foss offering that is also excellent.

How is atlassian's Sourcetree?

Re: Oh shit, git: Getting myself out of bad situations

#284
post #124

Earlier quoted context omitted.

My biggest issue with a GUI is that most that I've seen introduce new terms for various stuff, e.g. "sync" in VS Code, or "revert commit" (in Source Tree maybe?) — there's no Git command called "sync" or "revert", so I'm not immediately sure what they do. In a CLI I know exactly what's happening. That's just my opinion though. If people feel comfortable working in a GUI all the more power to them.

> no Git command called ... "revert" Maybe not in the way Source Tree uses it, but there certainly is[1]! I've had to use it a few times. > git-revert - Revert some existing commits [1] https://git-scm.com/docs/git-revert

My bad, then it was "reverse" in Source Tree (or whatever it was).

Re: Oh shit, git: Getting myself out of bad situations

#285
The fact web pages like this exist, and are popular, and make it to the top of Hacker News is all you need to know about git's ease-of-use and mental model.

That Perforce and SVN don't get such things should also tell you something.

(Which isn't to hate on git--it's a great tool.)

Re: Oh shit, git: Getting myself out of bad situations

#286

Earlier quoted context omitted.

My biggest issue with a GUI is that most that I've seen introduce new terms for various stuff, e.g. "sync" in VS Code, or "revert commit" (in Source Tree maybe?) — there's no Git command called "sync" or "revert", so I'm not immediately sure what they do. In a CLI I know exactly what's happening. That's just my opinion though. If people feel comfortable working in a GUI all the more power to them.

Git does have a revert command.

Yeah, my bad. Must've been "reverse" then. I just remember the revert/reverse dichotomy.

Re: Oh shit, git: Getting myself out of bad situations

#287
post #261

Earlier quoted context omitted.

You already have git-revert, for reverting commits without rewriting history.

You're misunderstanding the purpose i'm describing. Imagine 100 commits a day, maybe more. (I worked at a company that averaged 500 or more commits a day to the master branch. There were 1000 developers working in a monorepo). Some code is out in production, and suddenly we realize a specific commit is causing a problem. The idea here is to revert the commit as soon as you can, and then spend your time fixing it. Whe…

That sounds quite chaotic and impossible to keep stable. I wonder who was responsible to find problems and fix the master after messing up?

Re: Oh shit, git: Getting myself out of bad situations

#288
post #20

The very existence of such guides tells us a lot about how easy to use Git is :)

Name me any software that doesn't need a guide like this. like, how do you even exit vim? You need a guide for that. Or to get it closer to git / this guide, how do you undo / redo?

[deleted]

Re: Oh shit, git: Getting myself out of bad situations

#289
post #57
post #40

I always fight for people really learning git, because that's when it finally starts to get good. And I always tell people that git is not the tool that everybody should use. Most people just need a simple data storage with diff management, like Dropbox or SVN. But even after nearly 10 years, the pressure from the aint-nobody-got-time-for-that crowd is still there. I really, really hope that the git devs don't feel p…

They can certainly provide much better porcelain out of the box. Mercurial is at least as powerful as git, but I always joked that the learning curve between the two is something like, you read the docs for 5 mins and you'll know what the next 50 commands to type into hg. Whereas git, you spend 50 minutes reading the Pro Git book, just so you know what the next 5 commands should be.

Sorry, but you don't know git if you think Mercurial is even coming close.

That is not trolling btw. It's really possible not to know what you can do with it if you haven't learned it in depth.

The "Git Book" is what you should read. And you read it once, you read it indepth, and then you're done. After that it's also only 5 minutes of googling, but you can do a lot more. At that point you can even program a simplified git if you want.

Post reply on HN