Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Various changes - mostly formatting #1

Merged
merged 13 commits into from

2 participants

@nickmalcolm

Made some changes, mostly formatting (using the @word@ format consistently, not using it inside <pre> tags etc). There are two more noteworthy changes, first I try to explain add vs. commit using a mail analogy. The other is trying to explain the point of branches.

Feel free to take none, some or all of the changes :) Looking forward to the bootcamp!

@kuahyeow kuahyeow commented on the diff
README.textile
((6 lines not shown))
</pre>
<pre>
-Now, check the @status@ of @alice.txt@. Is it in the staging area now?
+Now, check the <b>status</b> of <b>alice.txt</b>. Is it in the staging area now?
@kuahyeow Owner

Yeah, any formatting in pre tags do not work. :) not a biggie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@kuahyeow kuahyeow merged commit 16bd073 into from
@kuahyeow
Owner

Awesome work @nickmalcolm !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 20 deletions.
  1. +23 −20 README.textile
View
43 README.textile
@@ -51,8 +51,7 @@ branches config description HEAD hooks info objects refs
h2. Adding new files
-Now, let's try adding some files into the project. Create a couple of files. For example, I
-create two files named @bob.txt@ and @alice.txt@.
+Now, let's try adding some files into the project. Create a couple of files. For example, I create two files named @bob.txt@ and @alice.txt@.
<pre>
@@ -60,10 +59,11 @@ In your working directory, create two files named alice.txt and bob.txt
</pre>
-In Git, you add content to the @staging area@ first by using @git add@ and then
-finalizing the process to record it into the git index by using @git commit@
+Let's use a mail analogy.
-Now to add the files to the staging area
+In Git, you first add content to the @staging area@ by using @git add@. This is like putting the stuff you want to send into a cardboard box. You finalize the process and record it into the git index by using @git commit@. This is like sealing the box - it's now ready to send.
+
+Let's add the files to the staging area
<pre><code>
$ git add alice.txt bob.txt
@@ -145,18 +145,20 @@ Now let's add our modified file to the staging area
<pre>
-Add @alice.txt@ to the staging area. (Ask for help if you are stumped)
+Add <b>alice.txt</b> to the staging area. (Ask for help if you are stumped)
</pre>
<pre>
-Now, check the @status@ of @alice.txt@. Is it in the staging area now?
+Now, check the <b>status</b> of <b>alice.txt</b>. Is it in the staging area now?
@kuahyeow Owner

Yeah, any formatting in pre tags do not work. :) not a biggie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
</pre>
-Let's say we did not like putting Lorem ipsum into @alice.txt@. One advantage of a staging area is to enable us to back out before we commit - which is a bit harder to back out of. Here's how to back out of the staging area :
+Let's say we did not like putting Lorem ipsum into @alice.txt@. One advantage of a staging area is to enable us to back out before we commit - which is a bit harder to back out of. Remembering the mail analogy - it's easier to take mail out of the cardboard box before you seal it than after.
+
+Here's how to back out of the staging area :
<pre><code>
$ git reset HEAD alice.txt
@@ -188,7 +190,9 @@ You have now un-done your changes. Your file is now empty
h2. Branching
-Creating a branch in Git is easy. The @git branch@ command, used by itself will list the branches you currently have
+Most large code bases have at least two branches - a 'live' branch and a 'development' branch. The live branch is code which is OK to be deployed on to a website, or downloaded by customers. The development branch allows developers to work on features which might not be bug free. Only once everyone is happy with the development branch would it be merged with the live branch.
+
+Creating a branch in Git is easy. The @git branch@ command, when used by itself, will list the branches you currently have
<pre><code>
$ git branch
@@ -198,7 +202,7 @@ $ git branch
The @*@ should indicate the current branch you are on, which is @master@.
-If you wish to start another branch, use @git branch (new-branch)@ :
+If you wish to start another branch, use @git branch (new-branch-name)@ :
<pre><code>
$ git branch exp1
@@ -215,7 +219,7 @@ $ git checkout exp1
Switched to branch 'exp1'
</code></pre>
-@git checkout (branch)@ is used to switch branches.
+@git checkout (branch-name)@ is used to switch branches.
Let's perform some commits now,
@@ -243,7 +247,7 @@ index 0000000..2ef267e
+some content
</pre></code>
-Basically what the above output says is that test.txt is present on the @exp1@ branch, but is absent on the @master@ branch.
+Basically what the above output says is that @test.txt@ is present on the @exp1@ branch, but is absent on the @master@ branch.
Git is good enough to handle your files when you switch between branches. Switch back to the @master@ branch
@@ -261,8 +265,7 @@ $ ls
README.textile alice.txt bob.txt gamow.txt
</code></pre>
-As you can see the new file you created in the other branch has disappeared. Not to worry, they are safely tucked away,
-and will re-appear when you switch back to that branch.
+As you can see the new file you created in the other branch has disappeared. Not to worry, it is safely tucked away, and will re-appear when you switch back to that branch.
<pre>
@@ -298,8 +301,7 @@ You always specify the branch you want to merge from, and you have to be in the
At this point, you can also try out @gitk@ to visualize the changes and how the two branches have merged
-Git is pretty good at merging automagically, even when the same file is edited. There are however,
-some situations where the same line of code is edited there is no way a computer can figure out how to merge.
+Git is pretty good at merging automagically, even when the same file is edited. There are however, some situations where the same line of code is edited there is no way a computer can figure out how to merge.
This will trigger a conflict which you will have to fix.
h2. Merge Conflicts
@@ -314,16 +316,16 @@ Branch alpher set up to track remote branch alpher from origin.
Switched to a new branch 'alpher'
</code></pre>
-You should now have a new branch called alpher. Try merging that branch into master now and fix the ensuing conflict.
+You should now have a new branch called @alpher@. Try merging that branch into @master@ now and fix the ensuing conflict.
<pre>
-Merge the @alper@ branch into @master (as you did when you merged exp1 into master) (Ask for help if stumped)
+Merge the alpher branch into master (as you did when you merged exp1 into master) (Ask for help if stumped)
</pre>
-You should see a @conflict@ with the gamow.txt file. This means that the same line of text was edited and committed on both the master branch and the alpher branch. The output below basically tells you the current situation
+You should see a @conflict@ with the @gamow.txt@ file. This means that the same line of text was edited and committed on both the master branch and the alpher branch. The output below basically tells you the current situation
<pre><code>
@@ -386,7 +388,7 @@ I throughly recommend these resources to continue your Git practice:
* <a href="http://progit.org">http://progit.org</a> (buy the book at http://tinyurl.com/amazonprogit)
* <a href="http://gitref.org">http://gitref.org</a>
-* http://www.kernel.org/pub/software/scm/git/docs/everyday.html
+* <a href="http://www.kernel.org/pub/software/scm/git/docs/everyday.html">http://www.kernel.org/pub/software/scm/git/docs/everyday.html</a>
@@ -395,3 +397,4 @@ h2. Author
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">http://creativecommons.org/licenses/by-nc-sa/3.0/</a>
Author: Thong Kuah
+Contributors: Nick Malcolm
Something went wrong with that request. Please try again.