Live data from Hacker News

Git Is Simpler Than You Think

nfarina.com

91–100 of 122 posts

Re: Git Is Simpler Than You Think

#91
post #41

The whole "downloading history of the repository onto your machine" thing about git is what makes it unworkable where I work. A normal checkout from SVN is over 3GB in size just for our team's tree. There are a number of binaries that get pulled in and updated for various reasons (SDKs, platform-specific binaries) and they are versioned for repeatable and automatable builds across branches, all self-contained with mi…

git-clone --depth 1

Shallow clones don't seem to save much space: http://blogs.gnome.org/simos/2009/04/18/git-clones-vs-shallo...

Re: Git Is Simpler Than You Think

#93
post #79
post #76

Earlier quoted context omitted.

Good advice. I would add the following use case: # Oh no! Those changes should have been on their own branch, not dev... git stash git checkout -b changes_on_their_own_branch git stash apply git commit -a

That is overly verbose. Try this: git checkout -b changes_on_their_own_branch git commit -a You can always create a new branch at HEAD (where you are currently) and switch to it without having to stash. On the other hand, stashing may be required if you wanted your branch to start elsewhere: git checkout -b changes_branch start_point

But doesn't git stop you from switching to another branch when there are uncommitted changes?

Re: Git Is Simpler Than You Think

#94

Although I love Git, this whole thread exemplifies the way in which Git horribly fails my one success measure for good tools: you don't talk about them very much.

Totally agree. We switched from SVN to Mercurial around 6 months ago and I have to say I am annoyed that I have to spend so much time messing around with the tool rather than coding.

Re: Git Is Simpler Than You Think

#95
post #79

Earlier quoted context omitted.

That is overly verbose. Try this: git checkout -b changes_on_their_own_branch git commit -a You can always create a new branch at HEAD (where you are currently) and switch to it without having to stash. On the other hand, stashing may be required if you wanted your branch to start elsewhere: git checkout -b changes_branch start_point

But doesn't git stop you from switching to another branch when there are uncommitted changes?

As GP said, not if you're creating a new branch. There's no history in the new branch to potentially overwrite your uncommitted changes in the working tree, so nothing for it to object to.

Re: Git Is Simpler Than You Think

#96
post #31
post #13

Love the concept of the article but right out of the gate comparing it to a Model T and saying you must be a mechanic to operate it will likely result in a high bounce rate, and possibly just serve to re-affirm someones belief that git is, indeed, complex.

Git is intended as a tool for programmers, which are precisely those "mechanics" he mentions. Any programmer who's scared away by that doesn't understand what they do.

Err - Maybe we just resent having to spend so much time on the mechanics of the tool/s rather than our main activity which is writing code.

Re: Git Is Simpler Than You Think

#97
post #96
post #31

Earlier quoted context omitted.

Git is intended as a tool for programmers, which are precisely those "mechanics" he mentions. Any programmer who's scared away by that doesn't understand what they do.

Err - Maybe we just resent having to spend so much time on the mechanics of the tool/s rather than our main activity which is writing code.

Oh, I agree. But if the net result is something that works better, the fact that it needs some internal tinkering shouldn't scare programmers away.

Re: Git Is Simpler Than You Think

#98

The sea parted for me when I caught Scott Chacon explaining git. http://www.youtube.com/watch?v=QF_OlomyKQQ It really is better in so many ways and once you understand how it works, you may say, like me, "Ahh, YES!" And, yeah, he warns you about rebase.

For me it really clicked when I watched: http://blip.tv/scott-chacon/git-talk-4113729 (also by Scott Chacon).

Once you understand the internals -- I remember being amazed at what .git/objects/ really was -- nearly everything about the git ecosystem becomes measurably easier to understand.

Once you understand how your project looks in the eyes of git, it becomes a breeze to manage.

Re: Git Is Simpler Than You Think

#99

Earlier quoted context omitted.

I found git to make a lot more sense personally after reading http://eagain.net/articles/git-for-computer-scientists/ . The git parable is also very good.

So if I have branched from master, onto experimental, and made several experimental changes that I want to actually use, then I can simply type: git merge master git branch master from the tip of my experimental branch, and master will be moved up to the tip of the tree?

fr0sty was definitely not tactful, but his commands are correct. Merge always brings the branch you specify onto the commit you are currently on. The branch command either lists branches (when no other arguments, only certain options, are specified) or creates branches. Checkout is the command used to move around between commits in your repository.

Branching and merging is covered pretty well by Pro Git[1]

[1] http://progit.org/book/ch3-2.html

Re: Git Is Simpler Than You Think

#100
post #63

Earlier quoted context omitted.

So if I have branched from master, onto experimental, and made several experimental changes that I want to actually use, then I can simply type: git merge master git branch master from the tip of my experimental branch, and master will be moved up to the tip of the tree?

Not at all. Where did you come up with that? That would merge in any commits in master not already in experimental and the next command would fail because a branch 'master' already exists. To do what you are describing you would do this (or something similar: git checkout master; git merge experimental

Thanks, obviously I'm missing some concept somewhere.
Post reply on HN