Hacker News new | past | comments | ask | show | jobs | submit login

The only concept that I can't put into my muscle memory is reverting changes for one file before commit. This is very easy in SVN but for some reason it's not intuitive git (at least for me), why there can't be something like `git revert filename`. Thankfully I have GitKraren that is helping me with things like that.



There is now (as of version 2.23.0), you can use:

git restore filename


Thank you that will help me a lot.


‘git checkout filename’ is the equivalent of ‘svn revert filename’


Yes, it works but not intuitive. I mean why use the checkout for the file reversion? And I think that's the problem of git: it's powerful and it works, but it's really not easy to get started.


It's like shorthand for git checkout <current branch> -- <files>. You're only omitting the current branch which is the default. I'm not sure if it's intuitive but it seems pretty coherent.

edit: on second thought no it's really not very coherent. If you exclude <files> it means checkout all files if you write a <branch>, but no files if you write no <branch>. So excluding <branch> doesn't consistently do the same as using <current branch>. I guess git does kind of suck.


There are numerous git <-> svn cheat sheets ... this is literally one of the first things I learned. I’m kind of bewildered by this to be honest ... I don’t know how somebody with a technical qualification could have trouble with this ...


We shouldn't need a cheat sheet. We shouldn't need Linus's brain dump to be able to use a tool. The Git UI directly models the Git internal model and that's just bad design. It's a completely leaky abstraction.

I can use git all right but the fact that I need about 20 different commands to do my job, 95% of them with extra parameters and almost all of them with names that don't reflect what I want to do from a functional point of view is utterly dumb. Again, functional! not technical! The UI should reflect end user functionality, not internal technical details.


[flagged]


With that attitude, I definitely wouldn't want to work with you either. I also love the assumptions about me and the thinly veiled ad-hominem :-)

We should be able to admit that a tool has a crap UI and cut out the macho geek attitude.

I've been working in this field for about of 15 years and the amount of needless pain we endure from core tools is unimaginable. I'm waaaay past the learning curve for Unix tools, git, etc., but let's not pretend that they're awesome UX wise. They're awful.

We've just learned to endure the pain and we've internalized it.

Stockholm syndrome at its finest.


[flagged]


Flaming other users like this and https://news.ycombinator.com/item?id=25121823 will get you banned on HN. Would you mind reviewing https://news.ycombinator.com/newsguidelines.html and sticking to the rules on HN? We've had to ask you this kind of thing more than once before. I don't want to ban you because you also post good things, but at some point protecting the ecosystem is more important.


Sorry. Thanks.


[flagged]


Please don't perpetuate tit-for-tat spats on HN. I know it's hard to walk away but they're tedious (to everyone else, at least) and off topic.

https://news.ycombinator.com/newsguidelines.html


Thanks for the :-) makes me feel like we're not having an argument any more.

As an engineer you should also know, that often assumptions are all you've got to go on. The only way to address uncertainty is to get into the details and figure out what's going on. Complaining loudly and fruitlessly about things is good for getting emotional support but it's not generally a good strategy for getting things done.


I refer to my comment from a couple of days ago: https://news.ycombinator.com/item?id=25080013


Oh my, that comment is pure gold :-)

Its putting into words something I've been thinking for a long time, thank you for the great comment!


That's just stupid. We're not talking about "users" here, we're talking about "engineers". If you can't grasp the complexity of Git, you've no business using it. You need to be working in an environment with a centralised VCS and somebody administering it.

Unless you mean just VCS for yourself, in which case you could probably just use anything you liked rather than complaining about it ...

And it's not manliness to say that if you can't grasp complexity you really shouldn't be writing code. That's self evident. It's the whole point of what we do. I'm not looking down on people who can't code - but it's horses for courses. To suggest anything else is just bonkers.


You could have read their comment as saying that they have things they'd rather be doing than learning Git. Instead you took the position that expressing a desire for nice tools is a sign of their total incompetence at programming, that they are complaining because they cannot grasp its complexity (despite them saying "I can use Git" which suggests they can grasp its complexity). You dismissed "The Git UI directly models the Git internal model and that's just bad design", launching straight into calling them stupid and saying they need handholding, for merely wanting good design - because good design makes things easier to use, and things being easier to use is for stupid people.

You could have argued that Git is easy to use and therefore they are stupid for not being able to use it. Or that the interface modelling the internal workings is a good design. Or that Git's complexity is necessary and no simpler interface is possible. Instead you agree that it is complex and thrill about the complexity and use it as a showoff point about how it makes you superior. That's the manliness part. Not as you willfully misrepresent it "if you can't grasp complexity you really shouldn't be writing code" but "if you don't want to spend your life on the complexity of a supporting tool unrelated to the problem you really want to solve you really shouldn't be writing code".

Git is a tool in support of programming, learning Git is not the whole point. Programming involves dealing with complexity (often in the sense of simplifying complexity and hiding it away), but that doesn't mean everything has to be complex to use, and it doesn't mean that someone has to enjoy the complexity in everything to be a good programmer.


I had no idea that checkout does that to files. In my head checkout was only for manipulating branches and revisions of whole repo




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: