Live data from Hacker News

Oh shit, git: Getting myself out of bad situations

ohshitgit.com

71–80 of 520 posts

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

#71

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…

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.

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

#72
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…

I don't think git will lose features, and even if they do, git's core and data model is really, really good - if you look closely, most commands are relatively simple operations on the relatively simple data model and tree structure. I'd say they'll continue the current direction, mostly adding missing features and changing the defaults to be more sane (like default push mechanics).

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

#73
Maybe it's not worth being in there because of how simple it is, but I guess it would be useful for newcomers:

    # Oh shit, I've changed 200 files and want to revert to the state of this morning
    $ git add . && git commit # often. Very often.
    $ git reset --hard commit_id

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

#74

Earlier quoted context omitted.

If by "designed" you mean "picking a content-addressable DAG as an underlying data structure", then yes, it is really beautiful. If you mean "provide a sane level of abstraction over said data structure", then hell no!

I think git provides a sane level of abstraction. I don't think it provides the most consistent UI or helpful help, though. Once you move away from "learning git commands" to "learning how git works" and kind of figuring out which parts the commands refer to has helped also. That's still terrible though.

> I don't think it provides the most consistent UI

That reminded a video where Linus Torvals is been interviewed and he says that if he ever have to make good UI to get out of a desert island, he would die there.

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

#75
post #36

Earlier quoted context omitted.

I'm planning on making a hard push for git on the team I just joined (that isn't using any VCS). This and OP are going in my bookmarks.

I'm genuinely curious how they manage source without any VCS. Is it just a bunch of zip files for old versions? No judgment, nobody is born knowing this stuff, just that I'm surprised to hear this is still out in the wild.

i know that some shops do nightly tape backups of the harddrive on the fileshare and consider that sufficient for version control. the theory is "developers don't have to learn a new tool and we will never lose more than one day's worth of work".

these shops don't understand the benefits version control offers when it comes to code review and maintenance patches on old versions of the software, or vendor-specific streams for your software.

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

#76

Earlier quoted context omitted.

> I'm planning on making a hard push for git on the team I just joined You mean a force push. `git push --force` is one of my favorite commands. I've aliased `git yolo` to `git push --force --no-verify`.

Maybe I ought to also insist I build git from source and scrub any reference to --force from it.

Use Gitlab and you can at least prevent --force push with permissions.

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

#77
post #31

We pushed large binaries into our git in the past. This was fine-ish as long as Git was hosted inhouse, but now that it's SAASed out, they are a huge pain in the rear. I've browsed through a few git guides, but can't seem to find anything that would let me: 1) Do something like "du -s *|sort -n" for the entire Git history 2) Let me "rm -rf --from-history-too", that would cause the remote repo to actually shrink in si…

https://help.github.com/articles/removing-sensitive-data-fro...

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

#79
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.

Git Kraken isn't FOSS. The site says "Free for non-commercial use", and AFAIK the source isn't available anywhere.

I think maybe the term you're looking for is "freeware"?

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

#80
post #20

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

By and large, git is easy to use. Most people will do little beyond committing changes and very occasional branching and merging with the likelihood of not needing any of the tips in the site posted.

For these users, git is perfectly useable and easy to use.

Post reply on HN