Skip to content

Commit dd124f7

Browse files
authored
Merge pull request #969 from progit/rework_files
Rework files
2 parents db94a47 + 80bd744 commit dd124f7

Some content is hidden

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

53 files changed

+319
-319
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[[_git_in_other_environments]]
1+
[[A-git-in-other-environments]]
22
[appendix]
33
== Git in Other Environments
44

@@ -7,18 +7,18 @@ You can work with local files, connect your repository to others over a network,
77
But the story doesn't end there; Git is usually used as part of a larger ecosystem, and the terminal isn't always the best way to work with it.
88
Now we'll take a look at some of the other kinds of environments where Git can be useful, and how other applications (including yours) work alongside Git.
99

10-
include::sections/guis.asc[]
10+
include::book/A-git-in-other-environments/sections/guis.asc[]
1111

12-
include::sections/visualstudio.asc[]
12+
include::book/A-git-in-other-environments/sections/visualstudio.asc[]
1313

14-
include::sections/eclipse.asc[]
14+
include::book/A-git-in-other-environments/sections/eclipse.asc[]
1515

1616

17-
include::sections/bash.asc[]
17+
include::book/A-git-in-other-environments/sections/bash.asc[]
1818

19-
include::sections/zsh.asc[]
19+
include::book/A-git-in-other-environments/sections/zsh.asc[]
2020

21-
include::sections/powershell.asc[]
21+
include::book/A-git-in-other-environments/sections/powershell.asc[]
2222

2323
=== Summary
2424

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[[_embedding_git_in_your_applications]]
1+
[[B-embedding-git-in-your-applications]]
22
[appendix]
33
== Embedding Git in your Applications
44

@@ -7,8 +7,8 @@ Even non-developer applications, such as document editors, could potentially ben
77

88
If you need to integrate Git with your application, you have essentially three choices: spawning a shell and using the Git command-line tool; Libgit2; and JGit.
99

10-
include::sections/command-line.asc[]
10+
include::book/B-embedding-git/sections/command-line.asc[]
1111

12-
include::sections/libgit2.asc[]
12+
include::book/B-embedding-git/sections/libgit2.asc[]
1313

14-
include::sections/jgit.asc[]
14+
include::book/B-embedding-git/sections/jgit.asc[]

book/C-git-commands/1-git-commands.asc renamed to C-git-commands.asc

Lines changed: 119 additions & 119 deletions
Large diffs are not rendered by default.

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
source 'https://rubygems.org'
22

33
gem 'rake'
4-
gem 'asciidoctor', '1.5.0'
4+
gem 'asciidoctor', '1.5.6.1'
55

66
gem 'json'
77
gem 'awesome_print'
88

9-
gem 'asciidoctor-epub3', '1.0.0.alpha.2'
10-
gem 'asciidoctor-pdf', '1.5.0.alpha.5'
9+
gem 'asciidoctor-epub3', :git => 'https://github.com/asciidoctor/asciidoctor-epub3'
10+
gem 'asciidoctor-pdf', '1.5.0.alpha.16'
1111

1212
gem 'coderay'
1313
gem 'pygments.rb'

book/01-introduction/sections/basics.asc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ image::images/snapshots.png[Git stores data as snapshots of the project over tim
2626
This is an important distinction between Git and nearly all other VCSs.
2727
It makes Git reconsider almost every aspect of version control that most other systems copied from the previous generation.
2828
This makes Git more like a mini filesystem with some incredibly powerful tools built on top of it, rather than simply a VCS.
29-
We'll explore some of the benefits you gain by thinking of your data this way when we cover Git branching in <<_git_branching#_git_branching>>.
29+
We'll explore some of the benefits you gain by thinking of your data this way when we cover Git branching in <<ch03-git-branching#ch03-git-branching>>.
3030

3131
==== Nearly Every Operation Is Local
3232

@@ -71,7 +71,7 @@ It is hard to get the system to do anything that is not undoable or to make it e
7171
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.
74-
For a more in-depth look at how Git stores its data and how you can recover data that seems lost, see <<_git_basics_chapter#_undoing>>.
74+
For a more in-depth look at how Git stores its data and how you can recover data that seems lost, see <<ch02-git-basics-chapter#_undoing>>.
7575

7676
==== The Three States
7777

@@ -105,4 +105,4 @@ The basic Git workflow goes something like this:
105105
If a particular version of a file is in the Git directory, it's considered committed.
106106
If it has been modified and was added to the staging area, it is staged.
107107
And if it was changed since it was checked out but has not been staged, it is modified.
108-
In <<_git_basics_chapter#_git_basics_chapter>>, you'll learn more about these states and how you can either take advantage of them or skip the staged part entirely.
108+
In <<ch02-git-basics-chapter#ch02-git-basics-chapter>>, you'll learn more about these states and how you can either take advantage of them or skip the staged part entirely.

book/01-introduction/sections/history.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ Some of the goals of the new system were as follows:
1717
* Able to handle large projects like the Linux kernel efficiently (speed and data size)
1818
1919
Since its birth in 2005, Git has evolved and matured to be easy to use and yet retain these initial qualities.
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#_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 <<ch03-git-branching#ch03-git-branching>>).

book/02-git-basics/sections/getting-a-repository.asc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $ git init
3838

3939
This creates a new subdirectory named `.git` that contains all of your necessary repository files -- a Git repository skeleton.
4040
At this point, nothing in your project is tracked yet.
41-
(See <<_git_internals#_git_internals>> for more information about exactly what files are contained in the `.git` directory you just created.)(((git commands, init)))
41+
(See <<ch10-git-internals#ch10-git-internals>> for more information about exactly what files are contained in the `.git` directory you just created.)(((git commands, init)))
4242

4343
If you want to start version-controlling existing files (as opposed to an empty directory), you should probably begin tracking those files and do an initial commit.
4444
You can accomplish that with a few `git add` commands that specify the files you want to track, followed by a `git commit`:
@@ -60,7 +60,7 @@ If you want to get a copy of an existing Git repository -- for example, a projec
6060
If you're familiar with other VCS systems such as Subversion, you'll notice that the command is "clone" and not "checkout".
6161
This is an important distinction -- instead of getting just a working copy, Git receives a full copy of nearly all data that the server has.
6262
Every version of every file for the history of the project is pulled down by default when you run `git clone`.
63-
In fact, if your server disk gets corrupted, you can often use nearly any of the clones on any client to set the server back to the state it was in when it was cloned (you may lose some server-side hooks and such, but all the versioned data would be there -- see <<_git_on_the_server#_getting_git_on_a_server>> for more details).
63+
In fact, if your server disk gets corrupted, you can often use nearly any of the clones on any client to set the server back to the state it was in when it was cloned (you may lose some server-side hooks and such, but all the versioned data would be there -- see <<ch04-git-on-the-server#_getting_git_on_a_server>> for more details).
6464

6565
You clone a repository with `git clone <url>`.(((git commands, clone)))
6666
For example, if you want to clone the Git linkable library called `libgit2`, you can do so like this:
@@ -84,4 +84,4 @@ That command does the same thing as the previous one, but the target directory i
8484

8585
Git has a number of different transfer protocols you can use.
8686
The previous example uses the `https://` protocol, but you may also see `git://` or `user@server:path/to/repo.git`, which uses the SSH transfer protocol.
87-
<<_git_on_the_server#_getting_git_on_a_server>> will introduce all of the available options the server can set up to access your Git repository and the pros and cons of each.
87+
<<ch04-git-on-the-server#_getting_git_on_a_server>> will introduce all of the available options the server can set up to access your Git repository and the pros and cons of each.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This means you have a clean working directory -- in other words, none of your tr
3434
Git also doesn't see any untracked files, or they would be listed here.
3535
Finally, the command tells you which branch you're on and informs you that it has not diverged from the same branch on the server.
3636
For now, that branch is always ``master'', which is the default; you won't worry about it here.
37-
<<_git_branching#_git_branching>> will go over branches and references in detail.
37+
<<ch03-git-branching#ch03-git-branching>> will go over branches and references in detail.
3838

3939
Let's say you add a new file to your project, a simple `README` file.
4040
If the file didn't exist before, and you run `git status`, you see your untracked file like so:
@@ -420,7 +420,7 @@ $ git commit
420420
----
421421

422422
Doing so launches your editor of choice.
423-
(This is set by your shell's `EDITOR` environment variable -- usually vim or emacs, although you can configure it with whatever you want using the `git config --global core.editor` command as you saw in <<_getting_started#_getting_started>>).(((editor, changing default)))(((git commands, config)))
423+
(This is set by your shell's `EDITOR` environment variable -- usually vim or emacs, although you can configure it with whatever you want using the `git config --global core.editor` command as you saw in <<ch01-getting-started#ch01-getting-started>>).(((editor, changing default)))(((git commands, config)))
424424

425425
The editor displays the following text (this example is a Vim screen):
426426

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ origin [email protected]:mojombo/grit.git (push)
6767
This means we can pull contributions from any of these users pretty easily.
6868
We may additionally have permission to push to one or more of these, though we can't tell that here.
6969

70-
Notice that these remotes use a variety of protocols; we'll cover more about this in <<_git_on_the_server#_getting_git_on_a_server>>.
70+
Notice that these remotes use a variety of protocols; we'll cover more about this in <<ch04-git-on-the-server#_getting_git_on_a_server>>.
7171

7272
==== Adding Remote Repositories
7373

@@ -103,7 +103,7 @@ From https://github.com/paulboone/ticgit
103103
----
104104

105105
Paul's master branch is now accessible locally as `pb/master` -- you can merge it into one of your branches, or you can check out a local branch at that point if you want to inspect it.
106-
(We'll go over what branches are and how to use them in much more detail in <<_git_branching#_git_branching>>.)
106+
(We'll go over what branches are and how to use them in much more detail in <<ch03-git-branching#ch03-git-branching>>.)
107107

108108
[[_fetching_and_pulling]]
109109
==== Fetching and Pulling from Your Remotes
@@ -123,7 +123,7 @@ So, `git fetch origin` fetches any new work that has been pushed to that server
123123
It's important to note that the `git fetch` command only downloads 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.
124124
You have to merge it manually into your work when you're ready.
125125

126-
If your current branch is set up to track a remote branch (see the next section and <<_git_branching#_git_branching>> for more information), you can use the `git pull` command to automatically fetch and then merge that remote branch into your current branch.(((git commands, pull)))
126+
If your current branch is set up to track a remote branch (see the next section and <<ch03-git-branching#ch03-git-branching>> for more information), you can use the `git pull` command to automatically fetch and then merge that remote branch into your current branch.(((git commands, pull)))
127127
This may be an easier or more comfortable workflow for you; and by default, the `git clone` command automatically sets up your local master branch to track the remote master branch (or whatever the default branch is called) on the server you cloned from.
128128
Running `git pull` generally fetches data from the server you originally cloned from and automatically tries to merge it into the code you're currently working on.
129129

@@ -142,7 +142,7 @@ $ git push origin master
142142
This command works only if you cloned from a server to which you have write access and if nobody has pushed in the meantime.
143143
If you and someone else clone at the same time and they push upstream and then you push upstream, your push will rightly be rejected.
144144
You'll have to fetch their work first and incorporate it into yours before you'll be allowed to push.
145-
See <<_git_branching#_git_branching>> for more detailed information on how to push to remote servers.
145+
See <<ch03-git-branching#ch03-git-branching>> for more detailed information on how to push to remote servers.
146146

147147
[[_inspecting_remote]]
148148
==== Inspecting a Remote

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ However, in the scenario described above, the file in your working directory is
9292
=====
9393

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

9797
==== Unmodifying a Modified File
9898

@@ -134,8 +134,8 @@ Any changes you made to that file are gone -- Git just copied another file over
134134
Don't ever use this command unless you absolutely know that you don't want the file.
135135
=====
136136

137-
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#_git_branching>>; these are generally better ways to go.
137+
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 <<ch03-git-branching#ch03-git-branching>>; these are generally better ways to go.
138138

139139
Remember, anything that is _committed_ in Git can almost always be recovered.
140-
Even commits that were on branches that were deleted or commits that were overwritten with an `--amend` commit can be recovered (see <<_git_internals#_data_recovery>> for data recovery).
140+
Even commits that were on branches that were deleted or commits that were overwritten with an `--amend` commit can be recovered (see <<ch10-git-internals#_data_recovery>> for data recovery).
141141
However, anything you lose that was never committed is likely never to be seen again.

0 commit comments

Comments
 (0)