Live data from Hacker News

Learn Git Branching

pcottle.github.com

71–80 of 144 posts

Re: Learn Git Branching

#72
Awesome visualization, but it seems to deviate from how git works in a few instances. Take "level mixed2" for example. The initial branch checked out was "caption". I did "git rebase -i master" and picked both commits (no re-ordering). That created C2' and C3' which is not correct. C2' wouldn't have been created because it's the same tree as C2 with the same ancestor.

I had other issues with that level as well. It seems to be teaching inefficient habits by forcing strange rebases rather than a single one with an "edit" on C2. I understand this might be a limitation on the (really cool) visualization, but maybe those levels shouldn't be included if you can't show the most intuitive way (at least to me) to accomplish the goal.

Otherwise, awesome work!

Re: Learn Git Branching

#73

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 -…

Thanks for all the hard work! As a git noob, this is extremely useful to me. Thanks again! By the way, what are some recommended git GUIs for linux?

Not OP but my feeling is that none of the git GUIs are particularly good or feature complete and I usually end up having to drop to a command line if I want to do anything interesting. That said, I really like `gitg` for its tree view and generally looking relatively nice, but I think functionality wise nothing really matches git gui and gitk, despite how ugly they are. Qgit is also kind of nice.

Re: Learn Git Branching

#74

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…

In both cases, the second 'git rebase' is just a fast-forward (moving the ref ahead without modifying the graph). Thus we need only distinguish what happens in the first 'git rebase', which is a different choice of which patch gets rewritten. Note that you can shorten

  git checkout bugFix
  git rebase master
to

  git rebase master bugFix

Re: Learn Git Branching

#75

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 -…

Fantastic work, I'd suggest that you provide walkthrough on each the solution, so that it's easy for people very new to git to follow along.

Re: Learn Git Branching

#76

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 -…

Absolutely brilliant work. I would love to see this expand out into a key reference for git beyond just learning branching. One great feature would be to support "learning modules" where anyone making a git tutorial could define their own lesson modules. This would go a long way to help people learn all the cool features of git, which is very daunting.

That's a great idea! Right now I'm totally willing to accept levels with the current functionality, but it would be great (like you said) to be able to cover all the aspects of git. Staging / committing, branching, and eventually origins.

I think the next thing on my plate is to implement origins, so you can demonstrate what a fetch / pull / pull --rebase really does

Re: Learn Git Branching

#77

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 discuss this on a github issue with you, we could go over the wording. Maybe something like "a commit specifies the entire state of a repository, but is usually stored on disk as a set of changes"?

EDIT: moving discussion to: https://github.com/pcottle/learnGitBranching/issues/6

EDIT: fixed in: https://github.com/pcottle/learnGitBranching/commit/168852b2...

Re: Learn Git Branching

#78
post #52

Earlier quoted context omitted.

I support a fairly wide range of zoom levels... from +3 levels zoomed in to almost any level zoomed out. The main reason why I can't do more than 4 is the way canvas pixels interact with screen pixels and some of the text positioning logic. If you're at a normal zoom level and getting that message, certainly let me know -- the zoom level detection logic is a unfortunately pretty hacky.

Please improve the error message to at least tell me what window sizes and zoom levels are supported.

I'm removing this for now, my apologies! This is what happens when a WIP gets submitted

Re: Learn Git Branching

#80

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 -…

Fantastic work, I'd suggest that you provide walkthrough on each the solution, so that it's easy for people very new to git to follow along.

That's a good idea. Right now I just blast the commands and hope you can follow along, but it would be nice to show the thinking behind the solution
Post reply on HN