Changes for page Getting Started with Git
Last modified by Bastian Triller on 2013/05/21 17:24
From version 89.1
edited by Kieran Kelleher
on 2011/08/10 22:15
on 2011/08/10 22:15
Change comment:
There is no comment for this version
To version 91.1
edited by Kieran Kelleher
on 2011/07/27 15:33
on 2011/07/27 15:33
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -16,13 +16,11 @@ 16 16 = Learn About Git = 17 17 18 18 * Learn the concepts. 19 -** Scott Chacon (of GitHub) Video Intro [[http://www.youtube.com/watch?v=ZDR433b0HJY]] 20 20 ** [[This>>http://www.eecs.harvard.edu/~~cduan/technical/git/]] is an excellent tutorial on the basic concepts behind Git 21 21 ** [[Git for Computer Scientists>>http://eagain.net/articles/git-for-computer-scientists/]] gives another good view on the underlying concepts 22 22 * Learn the basics. 23 23 ** [[Everyday GIT With 20 Commands Or So>>http://www.kernel.org/pub/software/scm/git/docs/everyday.html]] 24 24 ** [[Free Online Pro Git book>>http://progit.org/book/]] 25 -*** There is even a free epub version for your iPad/iPhone [[https://github.s3.amazonaws.com/media/progit.epub]] 26 26 27 27 * Get familiar with the reference materials available online 28 28 ** Official [[Git Documentation>>http://git-scm.com/documentation]] Site ... ... @@ -115,15 +115,13 @@ 115 115 116 116 What if one wants to generate a pull request the origin and also push to a fork? You would do this if you were not a Wonder committer but wanted to share code. You organize your changes in your local repository/branch and, from the clean repository or branch, generate the pull request and, separately, push the changes to your fork. 117 117 118 -=== TestingaPull-Request===116 +=== Versions? or Diffs? === 119 119 120 - It maynot be obvioushowtodothis.Ifoneis acommitter,thereis a buttononecanpush toautomaticallyaccept apull-request.But is thisreallyasafe thingtodo?Buthow canyouget the diffsbeingsuggested?Itseemsmorecomplicatedthanitneedstobetomerge thebranchthepull-requestwas made from.Onecan actuallysea URLthatspecifiesjust the diff.Ifthe pull-request isat[[https://github.com/projectwonder/wonder/pull/43]], onecando:118 +One satori that I had is this. Subversion is all about versions. CVS was all about versions. We have been working with these a long time and the ideas are sticky. Git is //not// about versions. It is about diffs. Diffs are the main thing. If you think about it, this makes sense. You have thoughts and make changes and those diffs are the product of your work. If you get those diffs into something, that is good, but the work product was the diffs. 121 121 122 -{{code}} 123 -curl 'https://github.com/projectwonder/wonder/pull/43.patch' | git am 124 -{{/code}} 120 +All this rebasing and such may seem odd. But the main thing is the diffs. I have edits from a two-week old repository. What do I do? I move the diffs so that they are diffs from the latest code. That is a rebase. When we make edits, we are used to being over-concerned about merge conflicts. But they do not happen all that often and are actually easy to deal with when they do, if the tools are oriented to making them easy to deal with. If we are worrying about the versions and not the diffs, we are paying attention to the paper we write on and not to the words we are putting down. 125 125 126 - The curlfetches thediff.Take offthe"git am"tojustsee thediffs.The"gitam"merges the diffs. Thenyoumaybuildand test the pull-request.Anormalpushwill push thecode into the repository.122 +Internally, git keeps track of text fragments and not files. Why is this? Because the versions are not the point. The diffs are. I can imagine how Linus Torvalds had this idea. He was looking at all the versions of all the files in Linux and all the e-mails of all the diffs. These are two separate worlds. It is conceptually painful to look at every diff, find its source and see how it maps to what now exists. At some point, he must have realized that all he needed was the e-mails. If he had no files any longer, but all the e-mails, he could always reconstruct the files. He would not have to make the conceptual switch from the diffs to the versions and back. Collectively, those e-mails with the diffs defined everything that needed to be said. Quod erat demonstrandum. 127 127 128 128 === How Easy Are Branches? === 129 129