You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/01-introduction/sections/basics.asc
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ We'll explore some of the benefits you gain by thinking of your data this way wh
30
30
31
31
==== Nearly Every Operation Is Local
32
32
33
-
Most operations in Git only need 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.
34
34
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.
35
35
Because you have the entire history of the project right there on your local disk, most operations seem almost instantaneous.
36
36
@@ -39,7 +39,7 @@ This means you see the project history almost instantly.
39
39
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.
40
40
41
41
This also means that there is very little you can't do if you're offline or off VPN.
42
-
If you get on an airplane or a train and want to do a little work, you can commit happily until you get to a network connection to upload.
42
+
If you get on an airplane or a train and want to do a little work, you can commit happily (to your _local_ copy, remember?) until you get to a network connection to upload.
43
43
If you go home and can't get your VPN client working properly, you can still work.
44
44
In many other systems, doing so is either impossible or painful.
45
45
In Perforce, for example, you can't do much when you aren't connected to the server; and in Subversion and CVS, you can edit files, but you can't commit changes to your database (because your database is offline).
@@ -66,7 +66,7 @@ In fact, Git stores everything in its database not by file name but by the hash
66
66
67
67
==== Git Generally Only Adds Data
68
68
69
-
When you do actions in Git, nearly all of them only add data to the Git database.
69
+
When you do actions in Git, nearly all of them only _add_ data to the Git database.
70
70
It is hard to get the system to do anything that is not undoable or to make it erase data in any way.
71
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.
72
72
@@ -88,18 +88,18 @@ This leads us to the three main sections of a Git project: the Git directory, th
88
88
image::images/areas.png["Working tree, staging area, and Git directory."]
89
89
90
90
The Git directory is where Git stores the metadata and object database for your project.
91
-
This is the most important part of Git, and it is what is copied when you clone a repository from another computer.
91
+
This is the most important part of Git, and it is what is copied when you _clone_ a repository from another computer.
92
92
93
93
The working tree is a single checkout of one version of the project.
94
94
These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify.
95
95
96
96
The staging area is a file, generally contained in your Git directory, that stores information about what will go into your next commit.
97
-
It's sometimes referred to as the ``index'', but it's also common to refer to it as the staging area.
97
+
Its technical name in Git parlance is the ``index'', but the phrase ``staging area'' works just as well.
98
98
99
99
The basic Git workflow goes something like this:
100
100
101
101
1. You modify files in your working tree.
102
-
2. You stage the files, adding snapshots of them to your staging area.
102
+
2. You selectively stage just those changes you want to be part of your next commit, which adds _only_ those changes to the staging area.
103
103
3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.
104
104
105
105
If a particular version of a file is in the Git directory, it's considered committed.
Copy file name to clipboardExpand all lines: book/01-introduction/sections/command-line.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
=== The Command Line
2
2
3
3
There are a lot of different ways to use Git.
4
-
There are the original commandline tools, and there are many graphical user interfaces of varying capabilities.
4
+
There are the original command-line tools, and there are many graphical user interfaces of varying capabilities.
5
5
For this book, we will be using Git on the command line.
6
-
For one, the command line is the only place you can run *all* Git commands – most of the GUIs only implement some subset of Git functionality for simplicity.
7
-
If you know how to run the commandline version, you can probably also figure out how to run the GUI version, while the opposite is not necessarily true.
6
+
For one, the command line is the only place you can run _all_ Git commands – most of the GUIs implement only a partial subset of Git functionality for simplicity.
7
+
If you know how to run the command-line version, you can probably also figure out how to run the GUI version, while the opposite is not necessarily true.
8
8
Also, while your choice of graphical client is a matter of personal taste, _all_ users will have the command-line tools installed and available.
9
9
10
10
So we will expect you to know how to open Terminal in Mac or Command Prompt or Powershell in Windows.
Copy file name to clipboardExpand all lines: book/01-introduction/sections/first-time-setup.asc
+15-3Lines changed: 15 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ You can also change them at any time by running through the commands again.
8
8
Git comes with a tool called `git config` that lets you get and set configuration variables that control all aspects of how Git looks and operates.(((git commands, config)))
9
9
These variables can be stored in three different places:
10
10
11
-
1. `/etc/gitconfig` file: Contains values for every user on the system and all their repositories.
11
+
1. `/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories.
12
12
If you pass the option `--system` to `git config`, it reads and writes from this file specifically.
13
-
2. `~/.gitconfig` or `~/.config/git/config` file: Specific to your user.
13
+
2. `~/.gitconfig` or `~/.config/git/config` file: Values specific personally to you, the user.
14
14
You can make Git read and write to this file specifically by passing the `--global` option.
15
15
3. `config` file in the Git directory (that is, `.git/config`) of whatever repository you're currently using: Specific to that single repository.
16
16
@@ -82,7 +82,7 @@ An example on a Windows system may include a prematurely terminated Git operatio
82
82
83
83
==== Checking Your Settings
84
84
85
-
If you want to check your settings, you can use the `git config --list` command to list all the settings Git can find at that point:
85
+
If you want to check your configuration settings, you can use the `git config --list` command to list all the settings Git can find at that point:
86
86
87
87
[source,console]
88
88
----
@@ -106,3 +106,15 @@ You can also check what Git thinks a specific key's value is by typing `git conf
106
106
$ git config user.name
107
107
John Doe
108
108
----
109
+
110
+
[NOTE]
111
+
====
112
+
Since Git might read the same configuration variable value from more than one file, it's possible that you have an unexpected value for one of these values and you don't know why.
113
+
In cases like that, you can query Git as to the _origin_ for that value, and it will tell you which configuration file had the final say in setting that value:
Copy file name to clipboardExpand all lines: book/01-introduction/sections/history.asc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,4 +17,4 @@ Some of the goals of the new system were as follows:
17
17
* Able to handle large projects like the Linux kernel efficiently (speed and data size)
18
18
19
19
Since its birth in 2005, Git has evolved and matured to be easy to use and yet retain these initial qualities.
20
-
It's incredibly fast, it's very efficient with large projects, and it has an incredible branching system for non-linear development (See <<_git_branching>>).
20
+
It's amazingly fast, it's very efficient with large projects, and it has an incredible branching system for non-linear development (See <<_git_branching>>).
Copy file name to clipboardExpand all lines: book/01-introduction/sections/installing.asc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Since Git is quite excellent at preserving backwards compatibility, any version
15
15
16
16
(((Linux, installing)))
17
17
If you want to install the basic Git tools on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution.
18
-
If you're on Fedora for example, you can use `dnf`:
18
+
If you're on Fedora for example (or any closely-related RPM-based distro such as RHEL or CentOS), you can use `dnf`:
0 commit comments