Skip to content

Commit dcf93a6

Browse files
committed
progit compiling
1 parent 8415302 commit dcf93a6

File tree

401 files changed

+20807
-0
lines changed

Some content is hidden

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

401 files changed

+20807
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[[A-git-in-other-environments]]
2+
[appendix]
3+
== Git in Other Environments
4+
5+
If you read through the whole book, you've learned a lot about how to use Git at the command line.
6+
You can work with local files, connect your repository to others over a network, and work effectively with others.
7+
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.
8+
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.
9+
10+
include::book/A-git-in-other-environments/sections/guis.asc[]
11+
12+
include::book/A-git-in-other-environments/sections/visualstudio.asc[]
13+
14+
include::book/A-git-in-other-environments/sections/visualstudiocode.asc[]
15+
16+
include::book/A-git-in-other-environments/sections/eclipse.asc[]
17+
18+
include::book/A-git-in-other-environments/sections/sublimetext.asc[]
19+
20+
include::book/A-git-in-other-environments/sections/bash.asc[]
21+
22+
include::book/A-git-in-other-environments/sections/zsh.asc[]
23+
24+
include::book/A-git-in-other-environments/sections/powershell.asc[]
25+
26+
=== Summary
27+
28+
You've learned how to harness Git's power from inside the tools that you use during your everyday work, and also how to access Git repositories from your own programs.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[[B-embedding-git-in-your-applications]]
2+
[appendix]
3+
== Embedding Git in your Applications
4+
5+
If your application is for developers, chances are good that it could benefit from integration with source control.
6+
Even non-developer applications, such as document editors, could potentially benefit from version-control features, and Git's model works very well for many different scenarios.
7+
8+
If you need to integrate Git with your application, you have essentially two options: spawn a shell and call the `git` command-line program, or embed a Git library into your application.
9+
Here we'll cover command-line integration and several of the most popular embeddable Git libraries.
10+
11+
include::book/B-embedding-git/sections/command-line.asc[]
12+
13+
include::book/B-embedding-git/sections/libgit2.asc[]
14+
15+
include::book/B-embedding-git/sections/jgit.asc[]
16+
17+
include::book/B-embedding-git/sections/go-git.asc[]
18+
19+
include::book/B-embedding-git/sections/dulwich.asc[]
20+

book-pro/C-git-commands.asc

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

book-pro/LICENSE.asc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
2+
To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0 or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

book-pro/Pro.ico

1.57 MB
Binary file not shown.

book-pro/README.asc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
= Pro Git, Second Edition
2+
3+
Welcome to the second edition of the Pro Git book.
4+
5+
You can find this book online at: https://git-scm.com/book
6+
7+
Like the first edition, the second edition of Pro Git is open source under a Creative Commons license.
8+
9+
A couple of things have changed since open sourcing the first edition.
10+
For one, we've moved from Markdown to the amazing Asciidoc format for the text of the book.
11+
12+
We've also moved to keeping the translations in separate repositories rather than subdirectories of the English repository.
13+
See link:TRANSLATING.md[the translating document] for more information.
14+
15+
== How To Generate the Book
16+
17+
You can generate the e-book files manually with Asciidoctor.
18+
If you run the following you _may_ actually get HTML, Epub, Mobi and PDF output files:
19+
20+
----
21+
$ bundle install
22+
$ bundle exec rake book:build
23+
Converting to HTML...
24+
-- HTML output at progit.html
25+
Converting to EPub...
26+
-- Epub output at progit.epub
27+
Converting to Mobi (kf8)...
28+
-- Mobi output at progit.mobi
29+
Converting to PDF...
30+
-- PDF output at progit.pdf
31+
----
32+
33+
== Signaling an Issue
34+
35+
Before signaling an issue, please check that there isn't already a similar one in the bug tracking system.
36+
37+
Also, if this issue has been spotted on the git-scm.com site, please cross-check that it is still present in this repo.
38+
The issue may have already been corrected, but the changes have not been deployed yet.
39+
40+
== Contributing
41+
42+
If you'd like to help out by making a change, take a look at the link:CONTRIBUTING.md[contributor's guide].

book-pro/Rakefile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
namespace :book do
2+
desc 'build basic book formats'
3+
task :build do
4+
5+
begin
6+
version_string = ENV['TRAVIS_TAG'] || `git describe --tags`.chomp
7+
if version_string.empty?
8+
version_string = '0'
9+
end
10+
date_string = Time.now.strftime("%Y-%m-%d")
11+
12+
# puts "Generating contributors list"
13+
# `git shortlog -s | grep -v -E "(Straub|Chacon)" | cut -f 2- | column -c 120 > book/contributors.txt`
14+
15+
params = "-D dist -a revnumber='#{version_string}' -a revdate='#{date_string}'"
16+
17+
# require = '--trace --require=asciidoctor-diagram'
18+
# require = '--trace -r asciidoctor-diagram'
19+
require = ''
20+
21+
require_pdf = '-r ./config/extensions/asciidoctor-pdf-extensions.rb'
22+
require_pdf = ''
23+
24+
puts "\r\n>> Converting to HTML..."
25+
cmd = "asciidoctor #{require} #{params} progit.asc 2>&1"
26+
puts cmd
27+
puts `#{cmd}`
28+
puts "\t-- HTML output at progit.html"
29+
30+
puts "\r\nConverting to PDF... (this one takes a while)"
31+
cmd = "bundle exec asciidoctor-pdf #{require} #{require_pdf} #{params} progit.asc 2>&1"
32+
puts cmd
33+
puts `#{cmd}`
34+
puts " -- PDF output at progit.pdf"
35+
36+
puts "\r\n>> Converting to EPub..."
37+
# cmd = "bundle exec asciidoctor-epub3 #{require} -a ebook-validate #{params} progit.asc 2>&1"
38+
cmd = "bundle exec asciidoctor-epub3 #{require} #{params} progit.asc 2>&1"
39+
puts cmd
40+
puts `#{cmd}`
41+
puts "\t-- Epub output at progit.epub"
42+
43+
puts "\r\nConverting to Mobi (kf8)..."
44+
puts `bundle exec asciidoctor-epub3 #{params} -a ebook-format=kf8 progit.asc 2>&1`
45+
puts " -- Mobi output at progit.mobi"
46+
47+
end
48+
end
49+
end
50+
51+
task :default => "book:build"

book-pro/TRANSLATION_NOTES.asc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
== Translation Notes
2+
3+
After forking this repository to translate the work, this file is where the notes for coordinating the translation work would go.
4+
Things like standardizing on words and expressions so that the work is consistent or notes on how the contributing process is to be handled.
5+
6+
As a translation maintainer, also feel free to modify or completely rewrite the README file to contain instructions specific to your translation.
7+
8+
=== Translation Status
9+
10+
As the work is translated, please update the `status.json` file to indicate the rough percentage complete each file is.
11+
This will be shown on various pages to let people know how much work is left to be done.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
=== About Version Control
2+
3+
(((version control)))
4+
What is ``version control'', and why should you care?
5+
Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.
6+
For the examples in this book, you will use software source code as the files being version controlled, though in reality you can do this with nearly any type of file on a computer.
7+
8+
If you are a graphic or web designer and want to keep every version of an image or layout (which you would most certainly want to), a Version Control System (VCS) is a very wise thing to use.
9+
It allows you to revert selected files back to a previous state, revert the entire project back to a previous state, compare changes over time, see who last modified something that might be causing a problem, who introduced an issue and when, and more.
10+
Using a VCS also generally means that if you screw things up or lose files, you can easily recover.
11+
In addition, you get all this for very little overhead.
12+
13+
==== Local Version Control Systems
14+
15+
(((version control,local)))
16+
Many people's version-control method of choice is to copy files into another directory (perhaps a time-stamped directory, if they're clever).
17+
This approach is very common because it is so simple, but it is also incredibly error prone.
18+
It is easy to forget which directory you're in and accidentally write to the wrong file or copy over files you don't mean to.
19+
20+
To deal with this issue, programmers long ago developed local VCSs that had a simple database that kept all the changes to files under revision control.
21+
22+
.Local version control.
23+
image::images/local.png[Local version control diagram]
24+
25+
One of the most popular VCS tools was a system called RCS, which is still distributed with many computers today.
26+
RCS works by keeping patch sets (that is, the differences between files) in a special format on disk; it can then re-create what any file looked like at any point in time by adding up all the patches.
27+
28+
==== Centralized Version Control Systems
29+
30+
(((version control,centralized)))
31+
The next major issue that people encounter is that they need to collaborate with developers on other systems.
32+
To deal with this problem, Centralized Version Control Systems (CVCSs) were developed.
33+
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)))
34+
For many years, this has been the standard for version control.
35+
36+
.Centralized version control.
37+
image::images/centralized.png[Centralized version control diagram]
38+
39+
This setup offers many advantages, especially over local VCSs.
40+
For example, everyone knows to a certain degree what everyone else on the project is doing.
41+
Administrators have fine-grained control over who can do what, and it's far easier to administer a CVCS than it is to deal with local databases on every client.
42+
43+
However, this setup also has some serious downsides.
44+
The most obvious is the single point of failure that the centralized server represents.
45+
If that server goes down for an hour, then during that hour nobody can collaborate at all or save versioned changes to anything they're working on.
46+
If the hard disk the central database is on becomes corrupted, and proper backups haven't been kept, you lose absolutely everything -- the entire history of the project except whatever single snapshots people happen to have on their local machines.
47+
Local VCS systems suffer from this same problem -- whenever you have the entire history of the project in a single place, you risk losing everything.
48+
49+
==== Distributed Version Control Systems
50+
51+
(((version control,distributed)))
52+
This is where Distributed Version Control Systems (DVCSs) step in.
53+
In a DVCS (such as Git, Mercurial, Bazaar or Darcs), clients don't just check out the latest snapshot of the files; rather, they fully mirror the repository, including its full history.
54+
Thus, if any server dies, and these systems were collaborating via that server, any of the client repositories can be copied back up to the server to restore it.
55+
Every clone is really a full backup of all the data.
56+
57+
.Distributed version control.
58+
image::images/distributed.png[Distributed version control diagram]
59+
60+
Furthermore, many of these systems deal pretty well with having several remote repositories they can work with, so you can collaborate with different groups of people in different ways simultaneously within the same project.
61+
This allows you to set up several types of workflows that aren't possible in centralized systems, such as hierarchical models.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=== The Command Line
2+
3+
There are a lot of different ways to use Git.
4+
There are the original command-line tools, and there are many graphical user interfaces of varying capabilities.
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 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+
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+
10+
So we will expect you to know how to open Terminal in macOS or Command Prompt or PowerShell in Windows.
11+
If you don't know what we're talking about here, you may need to stop and research that quickly so that you can follow the rest of the examples and descriptions in this book.

0 commit comments

Comments
 (0)