Hacker News new | ask | show | jobs
by envex 5104 days ago
Learning everything about git is hard, but learning enough git to use personally isn't that hard.

I use git personally to keep backups of my code and deploy sites I work on. I dont' work with other developers so my knowledge of git is workable, but probably super small.

Git gets complicated (but probably extremely useful) when working with bigger groups and tons of commits, branches and merges.

1 comments

I feel like there's not much point in any sort of VCS lesson if it doesn't go over the more complex areas though. For example, reverting commits and resetting to earlier points in history are pretty essential actions, but both have their subtleties in Git (e.g why reverting a merge is hard, what 'reset' vs 'checkout' do) that will bite you if you don't know what you're doing. And everyone's fucked up via git rebase at least once.

If you never need to merge, revert, or in general use any of the aspects of Git that make it special then it's totally reasonable to use something simpler like built-in OS versioning or a conceptually simpler VCS like SVN. But I guess there's no reason why Github would sponsor that, right?

Sorry, maybe I've just been using Git for long enough not to remember the pain, but can you explain "why reverting a merge is hard"?

Yeah, the Git command `revert` has a bunch of kind of esoteric flags, but once you understand that it can stomp on your working dir and/or your index, it's not that hard to use. I don't know what about reverting to a point prior to a merge would be difficult, unless you are in the middle of a merge at the time. Again, sounds like most trouble is caused by not understanding how to use what is a relatively powerful piece of software.

No one is stopping you from using the built-in OS versioning, SVN or Dropbox. IMO that would be a nightmare for anything beyond the most simple cases.

Reverting a merge with git revert is not hard but it is dangerous since if you want to merge the same branch later it will not merge the commit in the merged branch at the time of the reverted merge. You have to remember to revert the revert before attempting to merge again.
I disagree, I use the very basics of Git for my very small one man projects and was very happy about it! But it just so happened that some have grown to two or three man projects that benefited greatly of actually having a distributed system already setup, this wouldn't have happened if I would have been using the wrong tools! Git is quite easy to use a at a basic level and you know it will scale just as much as you probably need, I have no idea which of my projects will grow and how big, but I do know that using the right tools from the very beginning will not come back to bite me later!