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…
Learn Git Branching
81–90 of 144 posts
Re: Learn Git Branching
#82Re: Learn Git Branching
#83Wow! 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 -…
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
#84Earlier 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
Re: Learn Git Branching
#85Wow! 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.
Open up a github issue and I'll definitely throw something up
Re: Learn Git Branching
#86This 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…
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
#87Earlier 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
Re: Learn Git Branching
#88I 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 could commercialize it but it deserves to be free!
Re: Learn Git Branching
#89This 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…
Re: Learn Git Branching
#90Wow! 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 -…