peepcode-git-2.pdf

(1510 KB) Pobierz
588751991 UNPDF
$9
Internals
Source code control and beyond
by Scott Chacon
Git
588751991.001.png
Git Internals
other peepcode products
RSpec (
©2008 Scott Chacon
series on the popular behavior-driven development frame-
work.
Every effort was made to provide accurate information in this document.
However, neither Scott Chacon nor Topfunky Corporation shall have any
liability for any errors in the code or descriptions presented in this book.
Rails from Scratch (
http://peepcode.com ) – Learn Rails!
This document is available for US$9 at PeepCode.com ( http://peepcode.com ) .
Group discounts and site licenses can also be purchased by sending email
to peepcode@topfunky.com.
the concepts of application design with REST.
Subscription pack of 10 (
pack-of-10 ) – Save money! Buy 10 PeepCode credits.
with-prototypejs ) – Code conidently with Javascript!
Rails Code Review
code-review-pdf ) – Common mistakes in Rails applications,
and how to ix them.
2
RESTful Rails (
Javascript with Prototype (
 
contents
54 Using Git
111 Commands Overview
4 About this book
54 Setting Up Your Profile
111 Basic Git
5
Installing Git
55 Getting a Git Repository
115 Inspecting Repositories
5 Installing on Linux
57 Normal Workflow Examples
117 Extra Tools
6 Installing on Mac
63 Log – the Commit History
119 References and Endnotes
7 Windows
65 Browsing Git
119 Web Documentation
8 A Short History of Git
71 Searching Git
120 Screencasts
10
Understanding Git
72 Git Diff
121 Revisions
75 Branching
10 What is Git?
11 Focus and Design
77 Simple Merging
13 Git Object Types
80 Rebasing
22 The Git Data Model
86 Stashing
28 Branching and Merging
89 Tagging
41 The Treeish
91 Exporting Git
44 The Git Directory
92 The Care and Feeding of Git
48 Working Directory
94 Distributed Workflow Examples
49 The Index
105 Sharing Repositories
49 Non-SCM Uses of Git
107 Hosted Repositories
About this book
It took me a pretty long time to really get Git. As I’ve continued to
use Git more and more where I work, I’ve found myself trying to
teach people what it is and why we use it over and over again, and
the reality is that Git generally has a pretty steep learning curve
compared to many other systems. I’ve seen case after case of devel-
opers who love Git after they inally understand it, but getting to that
point is often somewhat painstaking.
This book is aimed at the developer who does not particularly like
Subversion, Perforce or whatever SCM system they are currently
using, has heard good things about Git, but doesn’t know where to
start or why it’s so wonderful. It is meant to explain Git as simply as
possible in a clean, concise, easily readable volume. My goal is to
help you understand Git internals as well as usage at a fundamental
level by the time you inish this book.
To accomplish this, I’m starting the book out (after the introduction)
with a section about what Git actually does , rather than how to use
it. I found that I didn’t really understand Git and had many problems
using it until I understood what it was actually doing at a low level,
rather than thinking of it as a different, weird SVN-like system.
4
588751991.002.png
Installing Git
chapter 1
Before we can start playing with Git, we’ll have to install it. I’ll quickly
cover installing Git on Linux, Mac and Windows. I will not get into
really ine detail, because others have done that much better, but I
will give you an overview and links as to where to ind more detailed
instructions on each platform.
For any of these examples, you can ind a link to the most current Git
source code at git.or.cz ( http://git.or.cz ) .
I would recommend compiling from source if possible, simply
because Git is lately making big strides in usability, so more current
versions may be a bit easier to use.
Installing on Linux
If you are installing from source, it will go something like the stan-
dard:
$ wget http://kernel.org/pub/software/scm/git/git-
1.5.4.4.tar.bz2
$ tar jxpvf git-1.5.4.4.tar.bz2
$ cd git-1.5.4.4
$ make prefix=/usr all doc info
$ sudo make prefix=/usr install install-doc install-info
If you are running Ubuntu or another Debian based system, you can
run
$ apt-get git-core
5
588751991.003.png
Zgłoś jeśli naruszono regulamin