This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

refacoring the articles

  • Loading branch information...
1 parent 1bbcf9a commit 5ad5f30b4729d513a00f1fa70229bf66b330fb48 @schacon schacon committed May 21, 2010
Showing with 212 additions and 99 deletions.
  1. +29 −0 OUTLINE
  2. +14 −33 episodes.yaml
  3. +1 −1 index.html
  4. +1 −1 p/branching.html
  5. +5 −7 p/intro.html
  6. +1 −1 p/log.html
  7. +50 −1 p/remotes.html
  8. +5 −5 p/setup.html
  9. +34 −32 pages/intro.markdown
  10. +54 −3 pages/remotes.markdown
  11. +18 −15 pages/setup.markdown
View
29 OUTLINE
@@ -0,0 +1,29 @@
+Introduction To Git
+ - what it is
+ - how it is different/better than subversion
+ - why use it
+
+Setup and Initialization
+ - downloading and installing
+ - setting it up (user/pass)
+ - some defaults to set
+
+Normal Workflow
+ - clone / init
+ - add / status / commit
+ - diff
+ - log (work dir)
+
+Branching and Merging
+ - branch
+ - merge
+
+Distributed Git
+ - push
+ - fetch
+ - (pull)
+
+Git History
+ - log
+ - diff (branches)
+
View
@@ -10,66 +10,47 @@ episodes:
- name: Setup and Initialization
page: setup
- cast: AeyWYQAI
+ cast: AeyWYQAI
size: 790x444
desc: Setup your Git environment, then create a
- new Git repository and clone an existing one.
+ new Git repository and clone an existing one.
- name: Normal Workflow
page: normal
- desc: Syncronize with a remote repository, make changes,
- then stage and commit them.
+ desc: Syncronize with a remote repository, make changes,
+ then stage and commit them.
- name: Branching and Merging
page: branching
desc: Create and work on topic and long running branches,
merge between them and delete them.
-
- - name: Git History
- page: log
- desc: Browse your project history, find specific commits
- and visualize the branching and merging actions.
- name: Distributed Git
page: remotes
- desc: Fetch, merge, pull and push between multiple remote
+ desc: Fetch, merge, pull and push between multiple remote
repositories.
+ - name: Git History
+ page: log
+ desc: Browse your project history, find specific commits
+ and visualize the branching and merging actions.
+
- section: Learn GitHub
- values:
+ values:
- name: Signup and Setup
desc: Create a new account, generate and upload your SSH key and clone your first repository.
-
+
- name: Site Overview
desc: An overview of the GitHub site tabs and main features. How to navigate and get familiar with GitHub.com.
- name: Sharing your Code
desc: Take a locally created Git repository and upload it to GitHub to share with others.
-
+
- name: Contributing
desc: Fork an existing project, add a feature and send a pull request to the maintainer.
-
+
- name: Customizing
desc: Use the existing or custom post-receive hooks and the API to customize your Git workflow.
- name: Maintaining a Project
desc: Accept pull requests and foster an active community around your GitHub project.
-
- - name: Network Graph
- desc: What is the network graph and how can you use it effectively to maintain your project?
-
- - name: Issues
- desc: A simple and easy to use issues/ticketing system for your open source project.
-
- - name: GitHub Pages
- desc: Using the GitHub pages system to generate Jeykll or static-html based sites for your project or user home page.
-
- - name: Compare View
- desc: Using the compare view and branch list pages to effectively peer-review a projects feature branches.
-
- - name: the Fork Queue
- desc: How to use the Fork Queue to cherry-pick commits from contributed branches on the server.
-
- - name: Subversion Integration
- desc: The features and limitations of GitHub's Subversion access.
-
View
@@ -65,7 +65,7 @@ <h1>Welcome to the GitHub Learning site</h1>
<hr/>
</div>
- <div class="span-24 last"><h2>Learn Git</h2></div><div class='span-4 episode'><b><a href="p/intro.html">Introduction To Git</a></b><p>What Git is, why you would want to use it and where to get it and learn about it.</p></div><div class='span-4 episode'><b><a href="p/setup.html">Setup and Initialization</a></b><p>Setup your Git environment, then create a new Git repository and clone an existing one.</p></div><div class='span-4 episode'><b><a href="p/normal.html">Normal Workflow</a></b><p>Syncronize with a remote repository, make changes, then stage and commit them.</p></div><div class='span-4 episode'><b><a href="p/branching.html">Branching and Merging</a></b><p>Create and work on topic and long running branches, merge between them and delete them.</p></div><div class='span-4 episode'><b><a href="p/log.html">Git History</a></b><p>Browse your project history, find specific commits and visualize the branching and merging actions.</p></div><div class='span-4 episode last'><b><a href="p/remotes.html">Distributed Git</a></b><p>Fetch, merge, pull and push between multiple remote repositories.</p></div><div class='span-24 last'><br/></div><div class="span-24 last"><h2>Learn GitHub</h2></div><div class='span-4 episode'><b>Signup and Setup</b><p>Create a new account, generate and upload your SSH key and clone your first repository.</p></div><div class='span-4 episode'><b>Site Overview</b><p>An overview of the GitHub site tabs and main features. How to navigate and get familiar with GitHub.com.</p></div><div class='span-4 episode'><b>Sharing your Code</b><p>Take a locally created Git repository and upload it to GitHub to share with others.</p></div><div class='span-4 episode'><b>Contributing</b><p>Fork an existing project, add a feature and send a pull request to the maintainer.</p></div><div class='span-4 episode'><b>Customizing</b><p>Use the existing or custom post-receive hooks and the API to customize your Git workflow.</p></div><div class='span-4 episode last'><b>Maintaining a Project</b><p>Accept pull requests and foster an active community around your GitHub project.</p></div><div class='span-24 last'><br/></div><div class='span-4 episode'><b>Network Graph</b><p>What is the network graph and how can you use it effectively to maintain your project?</p></div><div class='span-4 episode'><b>Issues</b><p>A simple and easy to use issues/ticketing system for your open source project.</p></div><div class='span-4 episode'><b>GitHub Pages</b><p>Using the GitHub pages system to generate Jeykll or static-html based sites for your project or user home page.</p></div><div class='span-4 episode'><b>Compare View</b><p>Using the compare view and branch list pages to effectively peer-review a projects feature branches.</p></div><div class='span-4 episode'><b>the Fork Queue</b><p>How to use the Fork Queue to cherry-pick commits from contributed branches on the server.</p></div><div class='span-4 episode last'><b>Subversion Integration</b><p>The features and limitations of GitHub's Subversion access.</p></div><div class='span-24 last'><br/></div>
+ <div class="span-24 last"><h2>Learn Git</h2></div><div class='span-4 episode'><b><a href="p/intro.html">Introduction To Git</a></b><p>What Git is, why you would want to use it and where to get it and learn about it.</p></div><div class='span-4 episode'><b><a href="p/setup.html">Setup and Initialization</a></b><p>Setup your Git environment, then create a new Git repository and clone an existing one.</p></div><div class='span-4 episode'><b><a href="p/normal.html">Normal Workflow</a></b><p>Syncronize with a remote repository, make changes, then stage and commit them.</p></div><div class='span-4 episode'><b><a href="p/branching.html">Branching and Merging</a></b><p>Create and work on topic and long running branches, merge between them and delete them.</p></div><div class='span-4 episode'><b><a href="p/remotes.html">Distributed Git</a></b><p>Fetch, merge, pull and push between multiple remote repositories.</p></div><div class='span-4 episode last'><b><a href="p/log.html">Git History</a></b><p>Browse your project history, find specific commits and visualize the branching and merging actions.</p></div><div class='span-24 last'><br/></div><div class="span-24 last"><h2>Learn GitHub</h2></div><div class='span-4 episode'><b>Signup and Setup</b><p>Create a new account, generate and upload your SSH key and clone your first repository.</p></div><div class='span-4 episode'><b>Site Overview</b><p>An overview of the GitHub site tabs and main features. How to navigate and get familiar with GitHub.com.</p></div><div class='span-4 episode'><b>Sharing your Code</b><p>Take a locally created Git repository and upload it to GitHub to share with others.</p></div><div class='span-4 episode'><b>Contributing</b><p>Fork an existing project, add a feature and send a pull request to the maintainer.</p></div><div class='span-4 episode'><b>Customizing</b><p>Use the existing or custom post-receive hooks and the API to customize your Git workflow.</p></div><div class='span-4 episode last'><b>Maintaining a Project</b><p>Accept pull requests and foster an active community around your GitHub project.</p></div><div class='span-24 last'><br/></div>
<div id="footer" class="span-24">
<div class="info span-12">
View
@@ -180,7 +180,7 @@ <h3 id='merging_multiple_times'>merging multiple times</h3>
<p>If the branch has not been merged in at some point, in which case deleting the branch would lose changes, Git will not allow you to do it. If you <em>want</em> to lose the changes, simply use the &#8216;-D&#8217; flag instead - that will force the deletion.</p>
-<p>So, that is basic branching and merging in Git and should give you a good baseline for being able to effectively use this powerful and ultimately pretty simple tool.</p><br/><br/><hr/></div><div class="span-10"><a href="normal.html">&laquo; previous</a></div><div style="text-align:right" class="span-11 last"><a href="log.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>So, that is basic branching and merging in Git and should give you a good baseline for being able to effectively use this powerful and ultimately pretty simple tool.</p><br/><br/><hr/></div><div class="span-10"><a href="normal.html">&laquo; previous</a></div><div style="text-align:right" class="span-11 last"><a href="remotes.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
View
@@ -82,7 +82,7 @@ <h3 id='offline_and_fast'>offline and fast</h3>
real 0m0.352s
user 0m0.300s
-sys 0m0.034s
+sys 0m0.034s
$ time svn log &gt; /dev/null
@@ -110,18 +110,16 @@ <h3 id='offline_and_fast'>offline and fast</h3>
real 0m6.219s
user 0m0.023s
-sys 0m0.011s </code></pre>
+sys 0m0.011s</code></pre>
<p>If you just want to commit and keep working, you&#8217;re looking at a huge time difference - one that severely changes your workflow. Most commands in Git seem instantaneous - no more typing &#8216;svn commit&#8217; and then going for a cup of coffee.</p>
<h3 id='small_vs_svn'>small (vs svn)</h3>
-<p>Git is also very space efficient. For example, the Django project has mirrors in several currently popular source control systems, and of all of them, the Git clone is the smallest.</p>
+<p>Git is also very space efficient. For example, if you import the Django project from SVN into Git and compare their checkout/clone sizes, Git comes out very favorably.</p>
<pre><code>$ du -d 1 -h
-108M ./django-bzr
44M ./django-git
- 53M ./django-hg
53M ./django-svn</code></pre>
<p>Interestingly, it is even smaller than the Subversion checkout, which is pretty amazing, considering that the Git clone contains the entire history of the project - every version of every file back to the first commit, whereas the Subversion checkout is just the last version of the project.</p>
@@ -148,11 +146,11 @@ <h3 id='cheap_branching_and_easy_merging'>cheap branching and easy merging</h3>
<h3 id='installing_git'>installing git</h3>
-<p>See the <a href='http://book.git-scm.com/2_installing_git.html'>Git Community Book</a> for details on how to install Git on your particular operating system.</p>
+<p>See the <a href='http://progit.org/book/ch1-4.html'>Pro Git Book</a> for details on how to install Git on your particular operating system. Or, simply go to the <a href='http://git-scm.com/download'>download</a> page on git-scm.com to get the source or an installer for your system.</p>
<h3 id='resources'>resources</h3>
-<p>For more information on Git, the homepage is at <a href='http://git-scm.com'>git-scm.com</a>.</p><br/><br/><hr/></div><div class="span-10">&nbsp;</div><div style="text-align:right" class="span-11 last"><a href="setup.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>For more information on Git, the homepage is at <a href='http://git-scm.com'>git-scm.com</a>. We will also be referring heavily to the CC-licenced <a href='http://progit.org'>Pro Git Book</a> for more information on each of these sections.</p><br/><br/><hr/></div><div class="span-10">&nbsp;</div><div style="text-align:right" class="span-11 last"><a href="setup.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
View
@@ -380,7 +380,7 @@ <h4 id='other_useful_options'>Other Useful Options</h4>
<pre><code>$ git log master.. --pretty=oneline</code></pre>
-<p>Very useful commands. We&#8217;ll explain why this works fully in a later section, but for now it&#8217;s useful to just remember that it does that.</p><br/><br/><hr/></div><div class="span-10"><a href="branching.html">&laquo; previous</a></div><div style="text-align:right" class="span-11 last"><a href="remotes.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
+<p>Very useful commands. We&#8217;ll explain why this works fully in a later section, but for now it&#8217;s useful to just remember that it does that.</p><br/><br/><hr/></div><div class="span-10"><a href="remotes.html">&laquo; previous</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
View
@@ -42,7 +42,56 @@ <h1>Distributed Git</h1>
</div>
<div class="content">
- <div class="span-21"><hr/><p>We touched on working with remotes in the Normal workflows section, but here we&#8217;ll really explore how to use the concept of having remote repositories to share and collaborate on Git projects with others.</p><br/><br/><hr/></div><div class="span-10"><a href="log.html">&laquo; previous</a></div><div class="span-24 last">&nbsp;</div><hr/>
+ <div class="span-21"><hr/><p>So you&#8217;ve heard that Git is a <strong>distributed</strong> version control system. What does that really mean and how do you take advantage of it?</p>
+
+<p>One of the cool things about Git versus centralized systems is that you can have more than one &#8216;server&#8217; that you can push to and pull from. In Git, this is called a &#8216;remote&#8217; and you can have several of them - some of which you can write to and others you can only read from. Here we&#8217;ll really explore how to use the concept of having remote repositories to share and collaborate on Git projects with others.</p>
+
+<h3 id='what_is_a_remote'>what is a remote?</h3>
+
+<p>A <code>remote</code> in Git is basically a way to tell Git where another version of your repository is. Then you can ask Git to fetch data from it that you don&#8217;t have yet, or push your commits up to it (if you have write access). This is much like the main Subversion server, but you can have several of them.</p>
+
+<h3 id='adding_remotes'>adding remotes</h3>
+
+<p>When you do a clone of a repository, Git will automatically add a remote reference for the repository you cloned, automatically naming it &#8216;origin&#8217;. This is an alias, so you don&#8217;t have to type the whole URL again when getting updates from it. Instead you can just run <code>git fetch origin</code> (instead of <code>git fetch git://server/path.git</code>).</p>
+
+<pre><code>$ git clone git://github.com/schacon/grack.git
+Initialized empty Git repository in /opt/grack/.git/
+remote: Counting objects: 85, done.
+remote: Compressing objects: 100% (76/76), done.
+remote: Total 85 (delta 31), reused 0 (delta 0)
+Receiving objects: 100% (85/85), 19.89 KiB, done.
+Resolving deltas: 100% (31/31), done.
+$ cd grack
+$ git remote
+origin
+$ git remote -v
+origin git://github.com/schacon/grack.git (fetch)
+origin git://github.com/schacon/grack.git (push)</code></pre>
+
+<p>If you created your repository with <code>git init</code> or would simply like to add another remote to a repository that you cloned, you can do so with the <code>git remote</code> command.</p>
+
+<pre><code>$ git remote add writey git@github.com:schacon/grack.git
+$ git remote -v
+origin git://github.com/schacon/grack.git (fetch)
+origin git://github.com/schacon/grack.git (push)
+writey git@github.com:schacon/grack.git (fetch)
+writey git@github.com:schacon/grack.git (push)</code></pre>
+
+<p>The name of the alias doesn&#8217;t really matter - you can call it just about anything you want. Now you have an alias for that URL, so you can use it to push to or fetch from. For instance, in this case if someone pushed to the URL I cloned my project from originally and I wanted to get the updates, I can just run:</p>
+
+<pre><code>$ git fetch origin</code></pre>
+
+<p>If I want to then write to my URL (which I named &#8216;writey&#8217; when I added it), I can run this:</p>
+
+<pre><code>$ git push writey master</code></pre>
+
+<p>That pushes my <code>master</code> branch to the <code>writey</code> aliased server.</p>
+
+<h3 id='fetching_and_pulling'>fetching and pulling</h3>
+
+<h3 id='pushing_to_remotes'>pushing to remotes</h3>
+
+<p>pushing and deleting branches</p><br/><br/><hr/></div><div class="span-10"><a href="branching.html">&laquo; previous</a></div><div style="text-align:right" class="span-11 last"><a href="log.html">next &raquo;</a></div><div class="span-24 last">&nbsp;</div><hr/>
</div>
<div id="footer" class="span-21">
Oops, something went wrong.

0 comments on commit 5ad5f30

Please sign in to comment.