
Pro Git, 2nd Edition - petercooper
http://git-scm.com/book/en/v2
======
schacon
I'm planning to write all of this up soon, but there are a few really
interesting things about the second edition.

For one, everything was changed from Markdown to Asciidoc and the entire book
can now be generated in multiple formats in the asciidoctor toolchain. Also,
we're using O'Reilly's Atlas platform to generate amazingly high-quality PDF,
ePub and Mobi versions automatically with every push to master. In every
language. This is a massive improvement over the previous version.

The other really interesting thing is the production process. We used GitHub
and prose diffs for the entire production of the book. I think we used about
100 Pull Requests to get to where we are now. This is a massive improvement
over how I collaborated with editors for the first version, the first few
chapters of which were actually done by sending Word documents back and forth.

~~~
BookMaker
Is there an open source alternative to the Atlas Platform that has similar
features? Thanks!

~~~
mhartl
Take a look at Softcover
([http://www.softcover.io/](http://www.softcover.io/)), which is a 100% open-
source ebook production toolchain used to produce the _Ruby on Rails Tutorial_
book (among others).

------
jeffreyrogers
This book is super helpful and I referred to it in the past while I was
learning Git. I want to note though that Git is pretty complex and trying to
learn it all at once is going to be extremely frustrating. Instead, just start
by learning the basics (push, pull, commit, clone, add, and maybe a few
others). Then, when you have a specific problem that you don't know how to
solve (How do I combine all these tiny commits into one substantial one?...
or, I screwed everything up, how do I revert to a previously good commit?),
look it up or Google for it. I still learn new things about Git this way and I
think I know my way around it pretty well. It's amazing that pretty much
anything I can think of Git already has implemented.

~~~
jdreaver
I just taught git to my boss and a coworker. They both use Windows exclusively
and don't touch a command line. I was able to teach them the basics (push,
pull, clone, commit, status) and they learned very quickly. I told them to
ignore the other commands for now, but look up how to use them when they need
them.

Great advice!

~~~
japhyr
What's the best approach to using fit on Windows? I am comfortable with git
basics on the Linux command line, and I want to teach it to students who are
using Windows.

Is there a windows command line version, or is there a GUI version I should
start them on?

~~~
raziel2p
If you run the default Git windows installer, it installs something called
"Git bash" which is basically msys (part of mingw) with git included, which
gives you command line access to git very easily. If you want to teach them
the CLI way from the start, that is the way to go.

~~~
mikevm
I believe that "Git for Windows" has been EOL'd in favor of
[https://github.com/git-for-windows/sdk](https://github.com/git-for-
windows/sdk) (which hasn't seen a first official release yet).

~~~
voltagex_
>This is an Inno Setup based wrapper around MinGW's mingw-get which installs a
development environment for building Git for Windows using GCC.

This installs the dependencies and environment needed for building Git from
source. I think that's overkill for most users.

------
lylejohnson
This is _the_ book that I recommend to colleagues who are learning Git. I
still refer back to it on occasion when I get into tricky situations with Git.
Looking forward to reading through this new edition.

~~~
JamesSwift
I don't think you can go wrong with anything Git related by Scott Chacon.

There used to be screencasts by him that were really good, quick tutorials of
running through common scenarios (branching, merging, rebasing, managing your
stash). I haven't been able to find them in a while. Those were really great
when I was learning how to do an interactive rebase.

~~~
rubikscube
A search for GitCasts gave some results, such as:

[https://www.youtube.com/playlist?list=PLttwD7NyH3omQLyVtan0C...](https://www.youtube.com/playlist?list=PLttwD7NyH3omQLyVtan0CFOX_UWItX_yG)

~~~
schacon
lol, gitcasts, nice! I totally forgot about these. Man, I should probably redo
them, I liked that series.

------
fsiefken
I really liked the 1st edition, good and full featured book on Git. Does
anyone know what the diff is with the 1st edition?

~~~
ben_straub
A _lot_. (Coauthor here.)

Not every sentence was rewritten, but 4 years is a long time. There was a lot
of content that was either inaccurate or out of date. We added content about
two-way bridges and migration to other VCSes, graphical clients, shell
integration, and lots more. There are also new chapters on GitHub and embedded
Git (Libgit2 and JGit).

------
hueving
It's interesting how github even got its own section in this book. Poor
bitbucket never gets any love. :(

~~~
ben_straub
Honestly, the reason is size. If you're a newcomer to OSS, it's very likely
that you'll end up with a GitHub user account, and much less so with
BitBucket.

We do mention BitBucket in the [forking workflows section]([http://git-
scm.com/book/en/v2/Distributed-Git-Contributing-t...](http://git-
scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#Forked-Public-
Project)), and many of the lessons from the GitHub chapter will carry over;
the two sites have a lot in common.

~~~
mhartl
GitHub is indeed the 800 lb. Git gorilla in the OSS world, so I don't doubt
that your main motivation is to serve the interests of your readers, but it's
probably a good idea to disclose the potential conflict of interest (namely,
that _Pro Git_ coauthor Scott Chacon was GitHub's first employee and still
works there).

~~~
schacon
I do actually cover this in the preface:
[https://github.com/progit/progit2/blob/master/book/preface.a...](https://github.com/progit/progit2/blob/master/book/preface.asc)

The conflict of interest does bother me, so I did try to be as clear as I
could about it and to point out at the beginning of the chapter that you could
easily skip it if you don't like or don't want to use GitHub. I also stayed
away from everything I could that required payment.

The truth is that I've been approached to write books specifically about
GitHub for several years so I thought that the demand for that sort of
information was high enough to warrant moving it to it's own chapter. Had I
been approached about writing about other resources I would probably have also
included them.

The more difficult decision was whether to include information on Gerrit. I
actually started writing a section on it, then considered a chapter or
appendix. The main deciding factor was how many people I thought might benefit
from it.

------
SimeVidas
Whoa. The Amazon link on that page links to the 1st edition. I almost ordered
it. _whev_ ^_^

~~~
ben_straub
Huh, we'll have to fix that. You can find the pre-order for the 2nd edition if
you search for it:

[http://www.amazon.com/gp/product/1484200772/ref=as_li_tl?ie=...](http://www.amazon.com/gp/product/1484200772/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1484200772&linkCode=as2&tag=prgi-20&linkId=KRFJFRKJDOZUA6WM)

~~~
troydj
Noticed that the price is double the price of the 1st edition. Is that due to
the number of authors doubling? ;)

~~~
schacon
Amazon pretty much sets the price themselves here, we have nothing to do with
it (nor do we get paid differently if you buy it for $50 or $20). I believe
generally Amazon (or any reseller) pays Apress about $15 per book, since
that's what our royalties are based off of.

------
michaelx386
This book just achieved the impossible and helped me understand the rebase
command properly. I'm ordering the printed version as soon as it's available.

------
luckydude
I'm liking asciidoc but wondering if anyone has married it to high quality
website "skins". I googled and found some websites done in asciidoc but they
all look pretty basic. Has anyone done anything that looks more professional,
like a marketing company did it? If it costs money that is fine.

------
jokoon
I still wonder what are the advantages of git over mercurial.

~~~
philsnow
It might be better to wonder what are the advantages of mercurial over git.

Better Windows support ? I think a huge proportion of OSS devs these days use
linux / osx.

It might be useful for mercurial to focus on making itself the premier OSS
DVCS for "enterprise"; that would create space between it and git / the git
userbase, and would allow for it to specialize in a meaningful way that is
perhaps less-easily forklifted into git.

~~~
mrbrowning
I'm a git user, but the one killer feature that Mercurial has that I'd love to
see appear in Git some day is revsets [1]. It's a DSL for selecting commits
from the repo's history that match a predicate, and you can easily create
complex predicates with it that would be much more difficult or impossible to
specify with git's brittle command line options.

[1]
[http://www.selenic.com/hg/help/revsets](http://www.selenic.com/hg/help/revsets)

~~~
philsnow
Those look very, very useful. Thanks for the pointer.

------
deevus
The mobi file is 105MB, which is over all of my email attachment limits.

Any ideas on how to send to my Kindles without uploading for each device?

~~~
schacon
So I just crushed the pngs which brings this down to 80M, but the problem is
the mobi format that is produced by kindlegen. I cover the issue here:
[https://github.com/progit/progit2/issues/116](https://github.com/progit/progit2/issues/116)

But basically Amazon produces a file with three files in it - the ePub source,
the older mobi7 format and the newer k8 format. This file is meant to be
uploaded to Amazon so you can download it from them. Amazon figures out what
Kindle you have and sends you the correct version from this file instead of
the whole 80M. It's unfortunate, but I'm not sure if I even _can_ take a
single format out of the bundle.

If you have a newer Kindle, you should just be able to send the ePub or PDF to
it. I'm not sure if it would be a lot worse or not though, I'll try it out.

------
asb
Somewhat offtopic, but I wonder why git-scm.com has still not been transferred
to the Software Freedom Conservancy [http://whois.domaintools.com/git-
scm.com](http://whois.domaintools.com/git-scm.com)

~~~
schacon
I believe I've actually offered to do this, but they haven't taken me up on
it. I'm almost positive that I actually got a domain transfer code for it once
but it was never transferred (I could be misremembering that though).

I think this just recently came up again when there was some issue with Heroku
legacy routing stuff and people seemed to think that it was better that I
continue to deal with it.

------
mate_
Thank you!

------
abhididdigi
Thank you!

