Live data from Hacker News

Learn Git Branching

pcottle.github.com

81–90 of 144 posts

Re: Learn Git Branching

#81

This tutorial is great, but it propagates a misconception about git. "A commit in git is a recorded set of changes that you have made" Git commits are _not_ deltas. They are entire snapshots of the repository and a single (optional) pointer to an ancestor commit[1]. Git may handle _compression_ in terms of deltas (see 'Packfiles' in [2]), but logically, a commit should be thought of as equivalent to the state of all…

Thanks a ton for catching this. I guess there is a distinction to be made -- the compression might use delta's, but a commit specifies the entire state of the repository. It's a tricky line to walk though, because commands like "git show" and "git patch" clearly show the delta-like nature of a single commit. I also don't want newcomers to think that commits are heavy and should be used sparingly. I'm totally down to…

That sounds reasonable, looks like someone has already opened an issue. :)

Re: Learn Git Branching

#83

Wow! Author here, did not expect this to get submitted to HN yet (was going to finish out a few more levels this weekend and clean everything up). Forgive the giant "TODO" in the help dialog The link everyone should see is the demo: http://pcottle.github.com/learnGitBranching/?demo That shows a few example commands, the completion of a level, and finishes with the help dialog. Some interesting technical highlights -…

So cool! I'm new to git (coming from mercurial) and think this would be awesome as a general purpose tutorial.

Unfortunately it seems to assume some knowledge. For example, rebase is introduced in a very understandable way, but then I need to know what "rebase -i HEAD~4" does without being introduced to those concepts.

Re: Learn Git Branching

#84
post #57

Earlier quoted context omitted.

For example the buttons does not work in the levels dialog. I would make a pull request if I could figure out how to build it with Grunt...

Fixed! Totally my bad, click event properties are super browser-specific

jQuery is here for that... You should use event.target.

Re: Learn Git Branching

#85

Wow! Author here, did not expect this to get submitted to HN yet (was going to finish out a few more levels this weekend and clean everything up). Forgive the giant "TODO" in the help dialog The link everyone should see is the demo: http://pcottle.github.com/learnGitBranching/?demo That shows a few example commands, the completion of a level, and finishes with the help dialog. Some interesting technical highlights -…

So cool! I'm new to git (coming from mercurial) and think this would be awesome as a general purpose tutorial. Unfortunately it seems to assume some knowledge. For example, rebase is introduced in a very understandable way, but then I need to know what "rebase -i HEAD~4" does without being introduced to those concepts.

True true, I was hoping to have a complete tutorial on positioning -- what master^^ does, HEAD~4, all of that. It was on my todo list but (for the millionth time) it got submitted without my knowledge.

Open up a github issue and I'll definitely throw something up

Re: Learn Git Branching

#86

This is a great tool, thanks so much ! I have trouble understanding the rebase workflow: What is the difference between these two sequences? git checkout -b bugFix git commit -m "fix" git checkout master git commit -m "master stuff" git rebase bugFix git checkout bugFix git rebase master and git checkout -b bugFix git commit -m "fix" git checkout master git commit -m "master stuff" git checkout bugFix git rebase mast…

Rebase works by discarding commits and replacing them with different commits.

If you rebase, then anyone who has the old commits in their repo will have to use git reset --hard to switch to the new branch. In other words, rebase inconveniences all other users of a branch. So you can use it freely on branches that only you work on, but you should be reluctant to use it on branches used by other people -- especially popular branches like "master".

If you use your first workflow, the app clearly shows that you discard the commit C3 ("master stuff") and replace it with a different commit C3'. This requires everyone on master to reset.

If you use your second workflow, the commit that you're discarding is C2 ("fix") instead. This means that only people who checked out C2 on bugFix need to reset.

Re: Learn Git Branching

#87

Earlier quoted context omitted.

So cool! I'm new to git (coming from mercurial) and think this would be awesome as a general purpose tutorial. Unfortunately it seems to assume some knowledge. For example, rebase is introduced in a very understandable way, but then I need to know what "rebase -i HEAD~4" does without being introduced to those concepts.

True true, I was hoping to have a complete tutorial on positioning -- what master^^ does, HEAD~4, all of that. It was on my todo list but (for the millionth time) it got submitted without my knowledge. Open up a github issue and I'll definitely throw something up

Haha, no worries. You did the work, I'm just peanut gallerying.

Re: Learn Git Branching

#88

I would seriously consider packaging this as an enterprise teaching tool for developers. Companies buy this sort of tools for training. Very good commercial potential here.

I also spoke to the Github guys about integrating this into their set of training tools (try.github and a few docs), but I think they got caught up with their full time responsibilities because I haven't heard back in a while.

I could commercialize it but it deserves to be free!

Re: Learn Git Branching

#89
post #86

This is a great tool, thanks so much ! I have trouble understanding the rebase workflow: What is the difference between these two sequences? git checkout -b bugFix git commit -m "fix" git checkout master git commit -m "master stuff" git rebase bugFix git checkout bugFix git rebase master and git checkout -b bugFix git commit -m "fix" git checkout master git commit -m "master stuff" git checkout bugFix git rebase mast…

Rebase works by discarding commits and replacing them with different commits. If you rebase, then anyone who has the old commits in their repo will have to use git reset --hard to switch to the new branch. In other words, rebase inconveniences all other users of a branch. So you can use it freely on branches that only you work on, but you should be reluctant to use it on branches used by other people -- especially po…

Thanks, that makes sense.

Re: Learn Git Branching

#90

Wow! Author here, did not expect this to get submitted to HN yet (was going to finish out a few more levels this weekend and clean everything up). Forgive the giant "TODO" in the help dialog The link everyone should see is the demo: http://pcottle.github.com/learnGitBranching/?demo That shows a few example commands, the completion of a level, and finishes with the help dialog. Some interesting technical highlights -…

What's the point of having a close button on a dialog window that doesn't close the dialog?
Post reply on HN