Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Git from Bottom Up

Git from Bottom Up

Ratings: (0)|Views: 5|Likes:
Published by Esteban Abait

More info:

Published by: Esteban Abait on Feb 16, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/10/2014

pdf

text

original

 
Gi
from the bottom up
 Wed,
Dec

by John WiegleyInmypursuittounderstandGit,itsbeenhelpfulformetounderstanditfromthebottomupratherthanlookatitonlyintermsofitshigh-levelcommands.AndsinceGitissobeauti-fullysimplewhenviewedthisway,IthoughtothersmightbeinterestedtoreadwhatI’vefound,and perhaps avoid the pain I went through
nding it.I used Git version 1.5.4.5 for each of the examples found in this document.
Contents
1. License22. Introduction33. Repository: Directory content tracking5
Introducing the blob6Blobs are stored in trees7How trees are made8
e beauty of commits10A commit by any other name12Branching and the power of rebase15
4.
e Index: Meet the middle man20
Taking the index farther22
5. To reset, or not to reset24
Doing a mixed reset24Doing a so
reset24Doing a hard reset25
6. Last links in the chain: Stashing and the re
og277. Conclusion308. Further reading31
 
License
isdocumentisprovidedunderthetermsoftheCreativeCommonsAttribution-ShareAlike3.0 United States License, which may be viewed at the following URL:
http://creativecommons.org/licenses/by-sa/3.0/us/
Inbrief,youmayusethecontentsofthisdocumentforanypurpose,personal,commercialorotherwise,solongasattributiontotheauthorismaintained.Likewise,thedocumentmaybemodi
ed,andderivativeworksandtranslationsmadeavailable,solongassuchmodi
cationsand derivations are o
ff 
ered to the public on equal terms as the original document.
http://www.newartisans.com/

/

/git-from-the-bottom-up.html©

,

John Wiegley-
-
 
Introduction
 WelcometotheworldofGit.Ihopethisdocumentwillhelptoadvanceyourunderstandingof thispowerfulcontenttrackingsystem,andrevealabitofthesimplicityunderlyingithowev-er dizzying its array of options may seem from the outside.Beforewedivein,thereareafewtermswhichshouldbementioned
rst,sincethey’llappearrepeatedly throughout this text:
repository 
A
repository 
is a collection of 
commits
, each of which is an archive of  what the project's
working tree
looked like at a past date, whether on your machine or someone else's. It also de
nes
 
(see below), whichidenti
es the branch or commit the current working tree stemmed from.Lastly, it contains a set of 
branches
and
tags
, to identify certain commitsby name.
the index
Unlike other, similar tools you may have used, Git does not commitchanges directly from the
working tree
into the
repository
. Instead,changes are
rst registered in something called
the index
.
ink of it asa way of “con
rming” your changes, one by one, before doing a commit(which records all your approved changes at once). Some
nd it helpfulto call it instead as the “staging area”, instead of the index.
 working tree
A
 working tree
is any directory on your
lesystem which has a
repository
 associated with it (typically indicated by the presence of a sub-directory within it named
.git
.). It includes all the
les and sub-directories inthat directory.
commit
A
commit
is a snapshot of your working tree at some point in time.
estate of 
 
(see below) at the time your commit is made becomes thatcommit’s parent.
is is what creates the notion of a “revision history”.
branch
A
branch
is just a name for a commit (and much more will be said aboutcommits in a moment), also called a reference. It’s the parentage of acommit which de
nes its history, and thus the typical notion of a“branch of development”.
tag 
A
tag 
is also a name for a commit, similar to a
branch
, except that it al- ways names the same commit, and can have its own description text.
http://www.newartisans.com/

/

/git-from-the-bottom-up.html©

,

John Wiegley-
-

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->