Skip to content

Commit 10be808

Browse files
authored
Merge pull request #870 from rpjday/basics
Minor tweaks (rewording, punct, adding lists) to "Git Basics"
2 parents 5f0a330 + 44fdadc commit 10be808

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

book/01-introduction/sections/basics.asc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
So, what is Git in a nutshell?
44
This is an important section to absorb, because if you understand what Git is and the fundamentals of how it works, then using Git effectively will probably be much easier for you.
5-
As you learn Git, try to clear your mind of the things you may know about other VCSs, such as Subversion and Perforce; doing so will help you avoid subtle confusion when using the tool.
6-
Git stores and thinks about information much differently than these other systems, even though the user interface is fairly similar, and understanding those differences will help prevent you from becoming confused while using it.(((Subversion)))(((Perforce)))
5+
As you learn Git, try to clear your mind of the things you may know about other VCSs, such as CVS, Subversion or Perforce -- doing so will help you avoid subtle confusion when using the tool.
6+
Even though Git's user interface is fairly similar to these other VCSs, Git stores and thinks about information in a very different way, and understanding these differences will help you avoid becoming confused while using it.(((Subversion)))(((Perforce)))
77

88
==== Snapshots, Not Differences
99

1010
The major difference between Git and any other VCS (Subversion and friends included) is the way Git thinks about its data.
1111
Conceptually, most other systems store information as a list of file-based changes.
12-
These systems (CVS, Subversion, Perforce, Bazaar, and so on) think of the information they keep as a set of files and the changes made to each file over time.
12+
These other systems (CVS, Subversion, Perforce, Bazaar, and so on) think of the information they store as a set of files and the changes made to each file over time (this is commonly described as _delta-based_ version control).
1313

1414
.Storing data as changes to a base version of each file.
1515
image::images/deltas.png[Storing data as changes to a base version of each file.]
1616

1717
Git doesn't think of or store its data this way.
18-
Instead, Git thinks of its data more like a set of snapshots of a miniature filesystem.
19-
Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot.
18+
Instead, Git thinks of its data more like a series of snapshots of a miniature filesystem.
19+
With Git, every time you commit, or save the state of your project, Git basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot.
2020
To be efficient, if files have not changed, Git doesn't store the file again, just a link to the previous identical file it has already stored.
2121
Git thinks about its data more like a *stream of snapshots*.
2222

@@ -30,11 +30,11 @@ We'll explore some of the benefits you gain by thinking of your data this way wh
3030

3131
==== Nearly Every Operation Is Local
3232

33-
Most operations in Git need only local files and resources to operate generally no information is needed from another computer on your network.
33+
Most operations in Git need only local files and resources to operate -- generally no information is needed from another computer on your network.
3434
If you're used to a CVCS where most operations have that network latency overhead, this aspect of Git will make you think that the gods of speed have blessed Git with unworldly powers.
3535
Because you have the entire history of the project right there on your local disk, most operations seem almost instantaneous.
3636

37-
For example, to browse the history of the project, Git doesn't need to go out to the server to get the history and display it for you it simply reads it directly from your local database.
37+
For example, to browse the history of the project, Git doesn't need to go out to the server to get the history and display it for you -- it simply reads it directly from your local database.
3838
This means you see the project history almost instantly.
3939
If you want to see the changes introduced between the current version of a file and the file a month ago, Git can look up the file a month ago and do a local difference calculation, instead of having to either ask a remote server to do it or pull an older version of the file from the remote server to do it locally.
4040

@@ -68,19 +68,19 @@ In fact, Git stores everything in its database not by file name but by the hash
6868

6969
When you do actions in Git, nearly all of them only _add_ data to the Git database.
7070
It is hard to get the system to do anything that is not undoable or to make it erase data in any way.
71-
As in any VCS, you can lose or mess up changes you haven't committed yet; but after you commit a snapshot into Git, it is very difficult to lose, especially if you regularly push your database to another repository.
71+
As with any VCS, you can lose or mess up changes you haven't committed yet, but after you commit a snapshot into Git, it is very difficult to lose, especially if you regularly push your database to another repository.
7272

7373
This makes using Git a joy because we know we can experiment without the danger of severely screwing things up.
7474
For a more in-depth look at how Git stores its data and how you can recover data that seems lost, see <<_undoing>>.
7575

7676
==== The Three States
7777

78-
Now, pay attention.
79-
This is the main thing to remember about Git if you want the rest of your learning process to go smoothly.
80-
Git has three main states that your files can reside in: committed, modified, and staged.
81-
Committed means that the data is safely stored in your local database.
82-
Modified means that you have changed the file but have not committed it to your database yet.
83-
Staged means that you have marked a modified file in its current version to go into your next commit snapshot.
78+
Pay attention now -- here is the main thing to remember about Git if you want the rest of your learning process to go smoothly.
79+
Git has three main states that your files can reside in: _committed_, _modified_, and _staged_:
80+
81+
* Committed means that the data is safely stored in your local database.
82+
* Modified means that you have changed the file but have not committed it to your database yet.
83+
* Staged means that you have marked a modified file in its current version to go into your next commit snapshot.
8484

8585
This leads us to the three main sections of a Git project: the Git directory, the working tree, and the staging area.
8686

0 commit comments

Comments
 (0)