Earlier quoted context omitted.
Git stage is "These are the things I'm planning to do", and git commit is "OK now do these things". Lots of carpenters draw plans before they start cutting but we don't think that's so hard do we? I had trouble with Git until I discovered "git add -p". I'll grant that Git could do with a revision of its commands and args.
> Git stage is "These are the things I'm planning to do", and git commit is "OK now do these things". Lots of carpenters draw plans before they start cutting but we don't think that's so hard do we? But when a carpenter stashes and unstashes their things, they don't suddenly find out they're magically planning to do a lot of things that they weren't previously planning to do.
Oh shit, git: Getting myself out of bad situations
501–510 of 520 posts
Re: Oh shit, git: Getting myself out of bad situations
#502Earlier quoted context omitted.
Git stage is "These are the things I'm planning to do", and git commit is "OK now do these things". Lots of carpenters draw plans before they start cutting but we don't think that's so hard do we? I had trouble with Git until I discovered "git add -p". I'll grant that Git could do with a revision of its commands and args.
The issue isn't with the level of abstraction, but with the side-effect based workflow of some of the more common commands. The most visible of these is unstaging a file. The syntax is "git reset -- ". What does that do? Well, it tells git not to change the head pointer. Of course, it wasn't going to do that anyway, but as a side effect of not doing anything, it makes a decision about what to do with all the staged f…
The neat thing is that Git is an expression of that UNIX philosophy in which tools have various layers that are separated. You can have the crazy Git syntax but you can also write another command (or a GUI) that wraps Git and gives you the set of sane commands you wish it had, and which covers 90% of your use-cases, while still keeping the original around in case you need it.
[Disclaimer: I've spent the past couple years doing exactly this (the GUI part) for a digital archives application. And to lmm's point up above my app does hide the staging step from the end-user.]
Re: Oh shit, git: Getting myself out of bad situations
#503Earlier quoted context omitted.
Thanks for telling me about tig, now I'm justified for having browsed HN today. It treats my "assume everything works like vim" habit well
tig is great -- it makes it very easy to stage individual lines of code (using 1) or to reset unstaged changes on a file (using ! in the status view).
Re: Oh shit, git: Getting myself out of bad situations
#504Earlier quoted context omitted.
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.
So far I've found: it's reasonably fast until I throw it at a huge monorepo :) but it still works (~2fps)! even `gitk` errors on this one. missing some hotkeys (like prev/next commit buttons in preview) freezes on remote-repo actions like fetch/pull/etc. likely due to our enterprisey ssh setup. generally missing a bit of polish. click targets are small, could use some more config (and only in one location, "search co…
I hadn't thought about the prev/next preview missing hotkeys, but you're right. I realized what I do is go into preview with space, leave preview with space, and then use the arrow keys to select the next commit I'm interested in. So in effect, "space, down, space" is hotkey for next commit.
Bummer about the remote freeze thing. I think the dev is reasonably responsive to bug reports.
I've got a list of things myself I think could be better, but I've been too lazy to attempt any of them. But I do try to proselytize in the hopes it'll pick up a bigger community. :-)
Re: Oh shit, git: Getting myself out of bad situations
#505Earlier quoted context omitted.
I take your original comment as an indictment that git is somehow broken by design. Which sure, you're entitled to an opinion, but to bring up SVN in the same breath is absurd. That's why I replied. I can't really address p4 because I haven't used it for any real world use cases. Only to prepare for an interview. With that limited use, I can't come with any reason to think it's superior.
You take my original comment incorrectly. I said nothing about how git is designed and how it may be broken. I made no claims about how Perforce may or may not be superior. I made no claim as to how SVN may or may not be superior. I made exactly one claim: These git cheatsheets on how to get out of a bad state get a lot of traction on Hacker News. That is a pretty good indicator of something. Let's think about what t…
Re: Oh shit, git: Getting myself out of bad situations
#506Earlier quoted context omitted.
I think you've put your finger on the schism of why so many git users prefer a GUI. The built-in porcelain is stupidly inconsistent and confusing. And yet, git's underlying model is so simple and powerful that I think it's worth suffering the bad CLI just to be more fluent and able to utilize git's power fully. The model itself is very easy to grok, it just takes some time to memorize the various random incantations…
The way you confuse git porcelain with git CLI makes it quite clear that you know nothing about either. I'm yet to find a GUI for any VCS that comes close to doing a job as good as any CLI.
git porcelain is a CLI. I am well aware that it is only a subset of git's CLI.
Re: Oh shit, git: Getting myself out of bad situations
#507Earlier quoted context omitted.
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…
Same here. Regrettably, if you UNDERSTAND git, a GUI won't work for you. If you're interested in understanding it, it won't work for you either. A GUI works fine if you want to get things done. If you like to know what goes on under the hood, it's just confuse you.
Re: Oh shit, git: Getting myself out of bad situations
#508Earlier quoted context omitted.
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.
Apparently, there is now also a windows version. https://www.git-tower.com/windows
Re: Oh shit, git: Getting myself out of bad situations
#509Earlier quoted context omitted.
Nope. That does no one any good. Using git verbage would, at the very least, acclimate them to very common terminology used by the rest of the folks they will eventually encounter.
Well, I disagree, because the alternative for many is probably no source control.
Re: Oh shit, git: Getting myself out of bad situations
#510Earlier quoted context omitted.
Even GUI based SQL tools show you a log of commands used... Git GUI clients don't even show you beforehand or after what the heck just happened... Sad.
It's definitely not true. I'm not sure what kind of gui did you use but both sourcetree and gitextensions show you the command log.