Skip to content

Commit 386b050

Browse files
committed
Merge pull request #84 from schacon/final-pass
Final pass
2 parents ec0c33f + c82fc2c commit 386b050

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+152
-106
lines changed
738 KB
Loading
240 Bytes
Loading

book/01-introduction/sections/basics.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The working directory is a single checkout of one version of the project.
9191
These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify.
9292

9393
The staging area is a file, generally contained in your Git directory, that stores information about what will go into your next commit.
94-
It’s sometimes referred to as the index, but it’s also common to refer to it as the staging area.
94+
It’s sometimes referred to as the ``index'', but it’s also common to refer to it as the staging area.
9595

9696
The basic Git workflow goes something like this:
9797

book/01-introduction/sections/first-time-setup.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Git comes with a tool called `git config` that lets you get and set configuratio
88
These variables can be stored in three different places:
99

1010
1. `/etc/gitconfig` file: Contains values for every user on the system and all their repositories.
11-
If you pass the option` --system` to `git config`, it reads and writes from this file specifically.
11+
If you pass the option `--system` to `git config`, it reads and writes from this file specifically.
1212
2. `~/.gitconfig` or `~/.config/git/config` file: Specific to your user.
1313
You can make Git read and write to this file specifically by passing the `--global` option.
1414
3. `config` file in the Git directory (that is, `.git/config`) of whatever repository you’re currently using: Specific to that single repository.

book/01-introduction/sections/installing.asc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Before you start using Git, you have to make it available on your computer.
44
Even if it's already installed, it's probably a good idea to update to the latest version.
55
You can either install it as a package or via another installer, or download the source code and compile it yourself.
66

7+
[NOTE]
8+
====
9+
This book was written using Git version *2.0.0*. Though most of the commands we use should work even in ancient versions of Git, some of them might not or might act slightly differently if you're using an older version. Since Git is quite excellent at preserving backwards compatibility, any version after 2.0 should work just fine.
10+
====
11+
712
==== Installing on Linux
813

914
(((Linux, installing)))
@@ -47,11 +52,13 @@ Another easy way to get Git installed is by installing GitHub for Windows.
4752
The installer includes a command line version of Git as well as the GUI.
4853
It also works well with Powershell, and sets up solid credential caching and sane CRLF settings.((Powershell))((CRLF))((credential caching))
4954
We'll learn more about those things a little later, but suffice it to say they're things you want.
55+
You can download this from the GitHub for Windows website, at http://windows.github.com[].
56+
5057

5158
==== Installing from Source
5259

5360
Some people may instead find it useful to install Git from source, because you’ll get the most recent version.
54-
The binary installers tend to be a bit behind, though as Git has matured in recent years, this tends to make a little less of a difference.
61+
The binary installers tend to be a bit behind, though as Git has matured in recent years, this has made less of a difference.
5562

5663
If you do want to install Git from source, you need to have the following libraries that Git depends on: curl, zlib, openssl, expat, and libiconv.
5764
For example, if you’re on a system that has yum (such as Fedora) or apt-get (such as a Debian based system), you can use one of these commands to install all of the dependencies:
2.79 KB
Loading

book/02-git-basics/sections/recording-changes.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ index 3cb747f..e445e28 100644
362362
Now that your staging area is set up the way you want it, you can commit your changes.
363363
Remember that anything that is still unstaged – any files you have created or modified that you haven’t run `git add` on since you edited them – won’t go into this commit.
364364
They will stay as modified files on your disk.
365-
In this case, the last time you ran `git status`, you saw that everything was staged, so you’re ready to commit your changes.(((git commands, status)))
365+
In this case, let's say that the last time you ran `git status`, you saw that everything was staged, so you’re ready to commit your changes.(((git commands, status)))
366366
The simplest way to commit is to type `git commit`:(((git commands, commit)))
367367

368368
[source,shell]
@@ -394,7 +394,7 @@ The editor displays the following text (this example is a Vim screen):
394394
You can see that the default commit message contains the latest output of the `git status` command commented out and one empty line on top.
395395
You can remove these comments and type your commit message, or you can leave them there to help you remember what you’re committing.
396396
(For an even more explicit reminder of what you’ve modified, you can pass the `-v` option to `git commit`.
397-
Doing so also puts the diff of your change in the editor so you can see exactly what you did.)
397+
Doing so also puts the diff of your change in the editor so you can see exactly what changes you're committing.)
398398
When you exit the editor, Git creates your commit with that commit message (with the comments and diff stripped out).
399399

400400
Alternatively, you can type your commit message inline with the `commit` command by specifying it after a -m flag, like this:

book/02-git-basics/sections/remotes.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ origin [email protected]:mojombo/grit.git (push)
5757

5858
This means we can pull contributions from any of these users pretty easily. We may additionally have permission to push to one or more of these, though we can't tell that here.
5959

60-
Notice that these remotes use a variety of protocols; we’ll cover why more about this in <<_git_on_the_server>>.
60+
Notice that these remotes use a variety of protocols; we’ll cover more about this in <<_git_on_the_server>>.
6161

6262
==== Adding Remote Repositories
6363

@@ -107,7 +107,7 @@ $ git fetch [remote-name]
107107
The command goes out to that remote project and pulls down all the data from that remote project that you don’t have yet.
108108
After you do this, you should have references to all the branches from that remote, which you can merge in or inspect at any time.
109109

110-
If you clone a repository, the command automatically adds that remote repository under the name origin.
110+
If you clone a repository, the command automatically adds that remote repository under the name ``origin''.
111111
So, `git fetch origin` fetches any new work that has been pushed to that server since you cloned (or last fetched from) it.
112112
It’s important to note that the `git fetch` command pulls the data to your local repository – it doesn’t automatically merge it with any of your work or modify what you’re currently working on.
113113
You have to merge it manually into your work when you’re ready.

book/02-git-basics/sections/undoing.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The `benchmarks.rb` file is modified but once again unstaged.
8282
While `git reset` _can_ be a dangerous command if you call it with `--hard`, in this instance the file in your working directory is not touched. Calling `git reset` without an option is not dangerous - it only touches your staging area.
8383
=====
8484

85-
For now this magic invocation is all you need to know about the `git reset` command. We'll go into much more detail about what `reset` does and how to master it to do really interesting things in <<_reset>>.
85+
For now this magic invocation is all you need to know about the `git reset` command. We'll go into much more detail about what `reset` does and how to master it to do really interesting things in <<_git_reset>>.
8686

8787
==== Unmodifying a Modified File
8888

@@ -123,7 +123,7 @@ It's important to understand that `git checkout -- [file]` is a dangerous comman
123123
Don’t ever use this command unless you absolutely know that you don’t want the file.
124124
=====
125125

126-
If you would like to keep the changes you've made to that file but still need to get it out of the way for now, we’ll go over stashing and branching in the next chapter; these are generally better ways to go.
126+
If you would like to keep the changes you've made to that file but still need to get it out of the way for now, we’ll go over stashing and branching in <<_git_branching>>; these are generally better ways to go.
127127

128128
Remember, anything that is __committed__ in Git can almost always be recovered.
129129
Even commits that were on branches that were deleted or commits that were overwritten with an `--amend` commit can be recovered (see <<data_recovery>> for data recovery).

book/02-git-basics/sections/viewing-history.asc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
2626
Author: Scott Chacon <[email protected]>
2727
Date: Sat Mar 15 16:40:33 2008 -0700
2828
29-
removed unnecessary test code
29+
removed unnecessary test
3030
3131
commit a11bef06a3f659402fe7563abf99ad00de2209e6
3232
Author: Scott Chacon <[email protected]>
@@ -71,7 +71,7 @@ commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
7171
Author: Scott Chacon <[email protected]>
7272
Date: Sat Mar 15 16:40:33 2008 -0700
7373
74-
removed unnecessary test code
74+
removed unnecessary test
7575
7676
diff --git a/lib/simplegit.rb b/lib/simplegit.rb
7777
index a0a60ae..47c6340 100644
@@ -110,7 +110,7 @@ commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
110110
Author: Scott Chacon <[email protected]>
111111
Date: Sat Mar 15 16:40:33 2008 -0700
112112
113-
removed unnecessary test code
113+
removed unnecessary test
114114
115115
lib/simplegit.rb | 5 -----
116116
1 file changed, 5 deletions(-)
@@ -140,7 +140,7 @@ In addition, the `short`, `full`, and `fuller` options show the output in roughl
140140
----
141141
$ git log --pretty=oneline
142142
ca82a6dff817ec66f44342007202690a93763949 changed the verison number
143-
085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7 removed unnecessary test code
143+
085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7 removed unnecessary test
144144
a11bef06a3f659402fe7563abf99ad00de2209e6 first commit
145145
----
146146

@@ -151,7 +151,7 @@ This is especially useful when you’re generating output for machine parsing
151151
----
152152
$ git log --pretty=format:"%h - %an, %ar : %s"
153153
ca82a6d - Scott Chacon, 6 years ago : changed the version number
154-
085bb3b - Scott Chacon, 6 years ago : removed unnecessary test code
154+
085bb3b - Scott Chacon, 6 years ago : removed unnecessary test
155155
a11bef0 - Scott Chacon, 6 years ago : first commit
156156
----
157157

0 commit comments

Comments
 (0)