Live data from Hacker News

Oh shit, git: Getting myself out of bad situations

ohshitgit.com

441–450 of 520 posts

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

#441

Earlier quoted context omitted.

Git does have a revert command.

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

Or perhaps it called revert but it wasn’t doing a git revert, it was doing a git checkout to simulate an SVN revert... I’ve seen this in at least one GUI. That kind of crap just makes it harder to unwind problems when things go wrong and to learn the tool.

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

#442

Earlier quoted context omitted.

It might not feelblike that big of a deal, but certainly there has got to be on any given day far more important things you can use those brain cycles for, yes? Low friction or not it's still friction. Friction that can be removed. Yet so many refuse to do so. There's something wrong with this this-is-how-we've-always-do-it picture.

You make it sound like tradition or a cargo cult—it's not. Git is fundamentally better than most of the alternatives, but in my opinion it's misguided to try to slap a better interface over the warts. Rewriting the porcelain would be good, but I don't think it's personally worth investing in until someone makes an attempt that's good enough to get traction and significant mindshare. In the meantime I've already made…

> Git is fundamentally better than most of the alternatives

No way. Only if you define “good” as “good at the kind of project that git is good at,” where it will hold vacuously.

I suffer daily through the cyst that is git LFS, and it’s a joke. It would be funny if it weren’t so tragic. I hear that it’s not doing any better in large scale mono repo land. Google doesn’t use it, afaik. Microsoft does (but multi repo, last I heard), Facebook doesn’t (custom Mercurial, some tasty quotes at [0]). Not a glowing “fundamentally better”, exactly.

[0] https://code.facebook.com/posts/218678814984400/scaling-merc...

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

#443
post #411

Earlier quoted context omitted.

I'm sorry if I sound rude. I don't mean to be. I'm just saying that backing up your git workspace to recover from rebases or merges gone wrong is not necessary. Those are not "surgical tools", they don't modify existing commits. (edit: yes you can "edit commits", but they only create new commits, the old commits are not deleted in the process and they can still be found easily) When you commit in git, that saves the…

> git reset --hard Unless part of your surgery involves files that do not yet live in the history, or you're working on a detached HEAD in a mid-merge state, or... git reset --hard is a very dangerous operation unless you're 100% sure of the entire state of the repository. That is a very rapid way to lose work if you're not perfectly diligent. And sure, you shouldn't have to back up .git or your workspace, but someti…

You could run git reset without the --hard parameter to keep unstaged changes in the working directory

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

#444

A git off my lawn moment: Every time I see someone complaining because they have to dive into the reflog to fix their own mistake, all I can hear is "I was operating my table saw without using a push stick and can't understand why I lost a thumb". Friends don't let friends (especially those who don't learn how to use their tools) rewrite shared git history. If you don't understand rebase, amends, etc can do to your (…

I use the reflog all the time to fix my own rebase mistakes; it's just on rebasing I've done locally, and where the results haven't made it out to a shared repo.

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

#445
Note that for fixing rebase mistakes, `git reflog` is not super user-friendly; each step in the rebase is included, including the ones that did not involve user intervention.

In those cases, it's better to use `git reflog $BRANCH_NAME`, which has the additional advantage of not including your switching from one branch to another.

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

#446

Earlier quoted context omitted.

It just pushes the current branch afaik.

So they should just call it 'push'. The word 'sync' is not in the Git terminology.

The GitHub desktop client is very limited and seems mostly geared toward a lone developer or small team who has never used git before. In this context I think it's a reasonable decision to use a more common verb.

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

#449

Earlier quoted context omitted.

You make it sound like tradition or a cargo cult—it's not. Git is fundamentally better than most of the alternatives, but in my opinion it's misguided to try to slap a better interface over the warts. Rewriting the porcelain would be good, but I don't think it's personally worth investing in until someone makes an attempt that's good enough to get traction and significant mindshare. In the meantime I've already made…

> Git is fundamentally better than most of the alternatives No way. Only if you define “good” as “good at the kind of project that git is good at,” where it will hold vacuously. I suffer daily through the cyst that is git LFS, and it’s a joke. It would be funny if it weren’t so tragic. I hear that it’s not doing any better in large scale mono repo land. Google doesn’t use it, afaik. Microsoft does (but multi repo, la…

I believe MS has most of windows in a git mono-repo now, enabled by a custom git-supporting filesystem they've developed:

https://github.com/Microsoft/GVFS

Pretty cool stuff. Doesn't seem to address the large-files case so much as the many-files case, though. I would love better git support for large files.

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

#450
post #422
post #187

Earlier quoted context omitted.

It's not anything inherent to a visual UI though, it's just that most of the UIs that exist are trying to put their own model on top of git, rather than embracing git's model. The one exception to this I've found is GitUp (mac only, sadly), and it's excellent. It's whole model is, "what operations can I perform on this graph," which is exactly the model git has. It's great.

http://gitup.co/ This looks fantastic, thanks for mentioning it! I've been looking for a GUI that doesn't mesh poorly with [whatever patterns my team uses] / without always pushing other features or a signup.

It's a really sweet piece of software, and I'm surprised it's not more popular. I'd be curious to hear how it ends up going for ya'll -- you can message me on twitter at @hazememry if you'd like.
Post reply on HN