Skip to content

Commit eba3784

Browse files
committed
Merge remote-tracking branch 'origin/master' into chapter-3-polish
Conflicts: book/03-git-branching/1-git-branching.asc
2 parents b065269 + 191c89b commit eba3784

File tree

8 files changed

+1190
-1027
lines changed

8 files changed

+1190
-1027
lines changed

OUTLINE.txt

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@
4242
* Limiting Log Output
4343
* Using a GUI to Visualize History
4444
2.4 Undoing Things
45-
* Reset Demystified
46-
* The Three Trees
47-
* The Workflow
48-
* The Role of Reset
49-
* Reset With a Path
50-
* A Fun Example
51-
* Check It Out
52-
* Summary
5345
* Changing Your Last Commit
5446
* Unstaging a Staged File
5547
* Unmodifying a Modified File
@@ -88,7 +80,7 @@
8880
* Topic Branches
8981
3.5 Remote Branches
9082
* Pushing
91-
* Tracking Branches
83+
* Tracking / Upstream Branches
9284
* Deleting Remote Branches
9385
3.6 Rebasing
9486
* The Basic Rebase
@@ -111,16 +103,7 @@
111103
4.4 Setting Up the Server
112104
4.5 Public Access
113105
4.6 GitWeb
114-
4.9 Git Daemon
115-
4.8 Gitolite
116-
* Installing
117-
* Customising the Install
118-
* Config File and Access Control Rules
119-
* Advanced Access Control with "deny" rules
120-
* Restricting pushes by files changed
121-
* Personal Branches
122-
* "Wildcard" repositories
123-
* Other Features
106+
4.7 Git Daemon
124107
4.X GitLab
125108
4.X Gerrit
126109
4.10 Other Hosting Options (bitbucket, stash, kiln, etc.)
@@ -198,14 +181,19 @@ X.X Summary
198181
* Double Dot
199182
* Multiple Points
200183
* Triple Dot
201-
6.2 Interactive Staging
202-
* Staging and Unstaging Files
203-
* Staging Patches
204-
6.3 Stashing
184+
6.3 Stashing and Cleaning
205185
* Stashing Your Work
206186
* Un-applying a Stash
207187
* Creating a Branch from a Stash
188+
* Git Clean
208189
6.X Searching (git grep)
190+
6.2 Interactive Staging
191+
* Staging and Unstaging Files
192+
* Staging Patches
193+
6.X Git Reset
194+
* The Three Trees of Git
195+
* Reset with a path
196+
* Reset vs Checkout
209197
6.4 Rewriting History
210198
* Changing the Last Commit
211199
* Changing Multiple Commit Messages

atlas.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"book/cover.html",
55
"LICENSE.asc",
66
"book/preface.asc",
7+
"book/toc.asc",
78
"book/01-introduction/1-introduction.asc",
89
"book/02-git-basics/1-git-basics.asc",
910
"book/03-git-branching/1-git-branching.asc",

book/01-introduction/1-introduction.asc

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[_getting_started]]
12
== Getting Started
23

34
This chapter will be about getting started with Git.
@@ -34,7 +35,7 @@ RCS works by keeping patch sets (that is, the differences between files) in a sp
3435

3536
The next major issue that people encounter is that they need to collaborate with developers on other systems.
3637
To deal with this problem, Centralized Version Control Systems (CVCSs) were developed.
37-
These systems, such as CVS, Subversion, and Perforce, have a single server that contains all the versioned files, and a number of clients that check out files from that central place. (((CVS)))(((Subversion)))(((Perforce)))
38+
These systems, such as CVS, Subversion, and Perforce, have a single server that contains all the versioned files, and a number of clients that check out files from that central place. (((CVS)))(((Subversion)))(((Perforce)))
3839
For many years, this has been the standard for version control.
3940

4041
.Centralized version control.
@@ -211,11 +212,11 @@ You can either install it as a package or via another installer, or download the
211212
==== Installing on Linux(((Linux, installing)))
212213

213214
If you want to install Git on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution.
214-
If you’re on Fedora, you can use yum:
215+
If you’re on Fedora for example, you can use yum:
215216

216217
$ yum install git
217218

218-
Or if you’re on a Debian-based distribution like Ubuntu, try apt-get:
219+
If you’re on a Debian-based distribution like Ubuntu, try apt-get:
219220

220221
$ apt-get install git
221222

@@ -245,32 +246,11 @@ The most official build is available for download on the Git website.
245246
Just go to http://git-scm.com/download/win[] and the download will start automatically.
246247
Note that this is a project called Git for Windows (also called msysGit), which is separate from Git itself; for more information on it, go to http://msysgit.github.io/[].
247248

248-
249249
Another easy way to get Git installed is by installing GitHub for Windows.
250250
The installer includes a command line version of Git as well as the GUI.
251251
It also works well with Powershell, and sets up solid credential caching and sane CRLF settings.
252252
We'll learn more about those things a little later, but suffice it to say they're things you want.
253253

254-
=== First-Time Git Setup
255-
256-
Now that you have Git on your system, you’ll want to do a few things to customize your Git environment.
257-
You should have to do these things only once on any given computer; they’ll stick around between upgrades.
258-
You can also change them at any time by running through the commands again.
259-
260-
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, config)))
261-
These variables can be stored in three different places:
262-
263-
1. `/etc/gitconfig` file: Contains values for every user on the system and all their repositories.
264-
If you pass the option` --system` to `git config`, it reads and writes from this file specifically.
265-
2. `~/.gitconfig` or `~/.config/git/config` file: Specific to your user.
266-
You can make Git read and write to this file specifically by passing the `--global` option.
267-
3. `config` file in the Git directory (that is, `.git/config`) of whatever repository you’re currently using: Specific to that single repository.
268-
269-
Each level overrides values in the previous level, so values in `.git/config` trump those in `/etc/gitconfig`.
270-
271-
On Windows systems, Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people).
272-
It also still looks for `/etc/gitconfig`, although it’s relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer.
273-
274254
==== Installing from Source
275255

276256
Some people may instead find it useful to install Git from source, because you’ll get the most recent version.
@@ -302,27 +282,53 @@ After this is done, you can also get Git via Git itself for updates:
302282

303283
$ git clone git://git.kernel.org/pub/scm/git/git.git
304284

285+
286+
=== First-Time Git Setup
287+
288+
Now that you have Git on your system, you’ll want to do a few things to customize your Git environment.
289+
You should have to do these things only once on any given computer; they’ll stick around between upgrades.
290+
You can also change them at any time by running through the commands again.
291+
292+
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, config)))
293+
These variables can be stored in three different places:
294+
295+
1. `/etc/gitconfig` file: Contains values for every user on the system and all their repositories.
296+
If you pass the option` --system` to `git config`, it reads and writes from this file specifically.
297+
2. `~/.gitconfig` or `~/.config/git/config` file: Specific to your user.
298+
You can make Git read and write to this file specifically by passing the `--global` option.
299+
3. `config` file in the Git directory (that is, `.git/config`) of whatever repository you’re currently using: Specific to that single repository.
300+
301+
Each level overrides values in the previous level, so values in `.git/config` trump those in `/etc/gitconfig`.
302+
303+
On Windows systems, Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people).
304+
It also still looks for `/etc/gitconfig`, although it’s relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer.
305+
305306
==== Your Identity
306307

307308
The first thing you should do when you install Git is to set your user name and e-mail address.
308-
This is important because every Git commit uses this information, and it’s immutably baked into the commits you pass around:
309+
This is important because every Git commit uses this information, and it’s immutably baked into the commits you start creating:
309310

310311
$ git config --global user.name "John Doe"
311312
$ git config --global user.email [email protected]
312313

313314
Again, you need to do this only once if you pass the `--global` option, because then Git will always use that information for anything you do on that system.
314315
If you want to override this with a different name or e-mail address for specific projects, you can run the command without the `--global` option when you’re in that project.
315316

316-
Many of the GUI tools will help you do this when you first run them as well.
317+
Many of the GUI tools will help you do this when you first run them.
317318

318319
==== Your Editor
319320

320321
Now that your identity is set up, you can configure the default text editor that will be used when Git needs you to type in a message.
321-
By default, Git uses your system’s default editor, which is generally vi or Vim.
322+
If not configured, Git uses your system’s default editor, which is generally Vim.
322323
If you want to use a different text editor, such as Emacs, you can do the following:
323324

324325
$ git config --global core.editor emacs
325326

327+
[NOTE]
328+
====
329+
Vim and Emacs are popular text editors often used by developers on Unix based systems like Linux and Mac. If you are not familiar with either of these editors or are on a Windows system, you may need to search for instructions for how to set up your favorite editor with Git.
330+
====
331+
326332
==== Checking Your Settings
327333

328334
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:
@@ -362,6 +368,6 @@ These channels are regularly filled with hundreds of people who are all very kno
362368

363369
=== Summary
364370

365-
You should have a basic understanding of what Git is and how it’s different from the CVCS you may have been using.
371+
You should have a basic understanding of what Git is and how it’s different from the centralized version control system you may have previously been using.
366372
You should also now have a working version of Git on your system that’s set up with your personal identity.
367373
It’s now time to learn some Git basics.

0 commit comments

Comments
 (0)