Live data from Hacker News

Oh shit, git (2016)

ohshitgit.com

161–170 of 280 posts

Re: Oh shit, git (2016)

#161
post #133

Earlier quoted context omitted.

HEAD~ means 'the second to last commit in the current branch' (ie. the second to last when you `git log`). git reset means 'point the current branch to this commit instead of wherver it's pointing now' (branches in git are just pointers to commits) git reset --hard means 'also reset the state of the checkout and staging area to be in sync with the commit' Thus, the entire spell means 'reset the current branch to make…

[Edit: It seems that I was mistaken but I'm leaving this up to illustrate the confusion. In my experience "second to last" isn't common and "next to last" is much more common, which I think is why I was confused because I thought they were different, but apparently they are the same. I wonder if there is a regional usage pattern to these phrases. ] This seems like mistake or a non-standard usage of the english phrase…

I don't know (definitely not a native English speaker), but Wikitionary seems to agree with me: https://en.wiktionary.org/wiki/second_to_last#English .

Re: Oh shit, git (2016)

#162
post #135

One thing that I had been looking for for a long time, but never could find, was a description of the several syntaxes you can use to refer to specific commits. Lots of git tutorials use these magic incantations, but none point you to this crucial bit of explanation. Recently I discovered that it is found under "git help revisions".

https://git-scm.com/docs/gitrevisions

Re: Oh shit, git (2016)

#163
post #161

Earlier quoted context omitted.

[Edit: It seems that I was mistaken but I'm leaving this up to illustrate the confusion. In my experience "second to last" isn't common and "next to last" is much more common, which I think is why I was confused because I thought they were different, but apparently they are the same. I wonder if there is a regional usage pattern to these phrases. ] This seems like mistake or a non-standard usage of the english phrase…

I don't know (definitely not a native English speaker), but Wikitionary seems to agree with me: https://en.wiktionary.org/wiki/second_to_last#English .

Well, I think you may be right. See my edit above. I suspect this is a regional usage pattern and I've just always been in places where "next to last" would be used and not "second to last" so I was thinking they were different, but they apparently are the same!

Learn something new every day.

Re: Oh shit, git (2016)

#164
post #161

Earlier quoted context omitted.

I don't know (definitely not a native English speaker), but Wikitionary seems to agree with me: https://en.wiktionary.org/wiki/second_to_last#English .

Well, I think you may be right. See my edit above. I suspect this is a regional usage pattern and I've just always been in places where "next to last" would be used and not "second to last" so I was thinking they were different, but they apparently are the same! Learn something new every day.

Here is an ngram analysis with a British corpus

https://books.google.com/ngrams/graph?content=second+last%2C...

And here is one with an American corpus:

https://books.google.com/ngrams/graph?content=second+last%2C...

Re: Oh shit, git (2016)

#165
post #35
post #20

Reading this article, I realize that I'm old now. I still remember wrestling with cvs, svn. Merge, branch were slow and even more challenging. It was much easier to mess up and so difficult to rewind. When I first learned git, I thought it's pretty neat. It solves merge, branch, rewind problems. Git is one of the things in life that doesn't work like the way we think. But it turns out to be a better way.

I’m torn. Practically Mercurial feels like it should be the winner. The commands are more uniform and predictable. That’s not all it has going for it either. Mercurial has a concept of commit stages to make history rewriting safer. It has a commit model that enables you to work on and manipulate branches of commits seamlessly, without needing named branches. It has not just a tree of commits but also each commit trac…

https://sr.ht supports mercurial now. I haven't used it yet, but it's a nice OSS option.

Re: Oh shit, git (2016)

#166
post #128

Many of these problems can be avoided by using a pull-request style workflow.

I don't see how prs would help solving any of those. It's common for me to use a few of these commands before I open the PR.

They stop you from pushing anything broken to master. So you only have to worry about being in a broken state locally on your machine, not about accidentally breaking master for everybody.

Ideally your code review system should be the only one to have merge rights to master. Then nobody can singularly break master at least.

Re: Oh shit, git (2016)

#167
post #45

Earlier quoted context omitted.

Hg actually does go beyond Git in many areas; I did outline a few but my favorites are the improved commit model (stages, natural branching, rewrite tracking,) the commands Git doesn’t have (absorb, evolve,) and the extensibility (see Facebook extensions.) Sure, the model is similar and Fossil is different. But that is kind of an important note. If Fossil can’t be compared on the same level, maybe that’s a sign it so…

> If Fossil can’t be compared on the same level, maybe that’s a sign it solves fundamentally different problems. Or Fossil provides a superset of the others. Like comparing a corkscrew, which only opens bottles of wine, to a swiss army knife that has a corkscrew. They both solve the same problem, but one of them also solves other problems and is generally a more useful tool to keep around in your pocket. The world di…

I don’t think people feel locked into proprietary bug tracking, they just choose it out of convenience. You can export data from Github or Gitlab.

I mean hell, trac and redmine have been around forever now. Is an open source wiki+bugtracker that revolutionary?

My best guess is that there’s some benefit of merging the source control in, but I’m not sure; it’s not like other environments can’t provide integrated bug tracking.

Re: Oh shit, git (2016)

#168
post #79

Earlier quoted context omitted.

I was thinking if I would post what you did it would get downvoted but yeah, if you find git hard how or why are you writing code? That is surely a lot harder. Not sure why it is downvoted as sure it might not be a popular opinion but it seems to hold...

I want to focus on code and not be wrestling with a version control system.

[deleted]

Re: Oh shit, git (2016)

#169
post #115

Am I the only one who reads "reflog" as "re-flog", that is, to be painfully whipped again?

I will now forever. Reminds me of when you read "therapist" as "the rapist".

It's always Sunny in Philadelphia ruined "philanthropist" ("full on rapist") for me, forever.

Re: Oh shit, git (2016)

#170
post #53

Earlier quoted context omitted.

Git is ugly and daunting when you start with it, but as you get to know it you start to appreciate it's beauty and elegance and it will work for you. Actually I find this with many programming concepts.

Even after years of Git usage, `git reset --soft -- file`, `git reset --mixed -- file`, BUT `git checkout file` instead of `git reset --hard -- file` is ugly and symptomatic of Git's lackluster UX.

Has there been any efforts to add a wrapper around git's commands to make a more friendly command line UI?

I've tried maybe 3 different GUIs for git and none of them really seemed to help that much. However my usage of git is pretty basic, with branches and tags being about as complex as I get.

Post reply on HN