projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Autogenerated HTML docs for v1.2.0-g6a9b
[git.git]
/
core-tutorial.html
diff --git
a/core-tutorial.html
b/core-tutorial.html
index
5800774
..
9dfa534
100644
(file)
--- a/
core-tutorial.html
+++ b/
core-tutorial.html
@@
-3,7
+3,7
@@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
\r
<head>
\r
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\r
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
\r
<head>
\r
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\r
-<meta name="generator" content="AsciiDoc 7.0.
1
" />
\r
+<meta name="generator" content="AsciiDoc 7.0.
2
" />
\r
<style type="text/css">
\r
/* Debug borders */
\r
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
\r
<style type="text/css">
\r
/* Debug borders */
\r
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
\r
@@
-329,9
+329,9
@@
three entries, among other things:</p>
<ul>
\r
<li>
\r
<p>
\r
<ul>
\r
<li>
\r
<p>
\r
-a
symlink called <tt>HEAD</tt>, pointing to <tt>refs/heads/master</tt> (if your
\r
- platform does not have native symlinks, it is a file containing the
\r
- line "ref: refs/heads/master")
\r
+a
file called <tt>HEAD</tt>, that has <tt>ref: refs/heads/master</tt> in it.
\r
+ This is similar to a symbolic link and points at
\r
+ <tt>refs/heads/master</tt> relative to the <tt>HEAD</tt> file.
\r
</p>
\r
<p>Don't worry about the fact that the file that the <tt>HEAD</tt> link points to
\r
doesn't even exist yet — you haven't created the commit that will
\r
</p>
\r
<p>Don't worry about the fact that the file that the <tt>HEAD</tt> link points to
\r
doesn't even exist yet — you haven't created the commit that will
\r
@@
-358,7
+358,7
@@
of different <em>heads</em> of development (aka <em>branches</em>), and to any
<em>tags</em> that you have created to name specific versions in your
\r
repository.</p>
\r
<p>One note: the special <tt>master</tt> head is the default branch, which is
\r
<em>tags</em> that you have created to name specific versions in your
\r
repository.</p>
\r
<p>One note: the special <tt>master</tt> head is the default branch, which is
\r
-why the <tt>.git/HEAD</tt> file was created
as a symlink
to it even if it
\r
+why the <tt>.git/HEAD</tt> file was created
points
to it even if it
\r
doesn't yet exist. Basically, the <tt>HEAD</tt> link is supposed to always
\r
point to the branch you are working on right now, and you always
\r
start out expecting to work on the <tt>master</tt> branch.</p>
\r
doesn't yet exist. Basically, the <tt>HEAD</tt> link is supposed to always
\r
point to the branch you are working on right now, and you always
\r
start out expecting to work on the <tt>master</tt> branch.</p>
\r
@@
-406,8
+406,8
@@
get a feel for how this works:</p>
<pre><tt>$ echo "Hello World" >hello
\r
$ echo "Silly example" >example</tt></pre>
\r
</div></div>
\r
<pre><tt>$ echo "Hello World" >hello
\r
$ echo "Silly example" >example</tt></pre>
\r
</div></div>
\r
-<p>you have now created two files in your working tree (aka <em>working directory</em>),
but to
\r
-actually check in your hard work, you will have to go through two steps:</p>
\r
+<p>you have now created two files in your working tree (aka <em>working directory</em>),
\r
+
but to
actually check in your hard work, you will have to go through two steps:</p>
\r
<ul>
\r
<li>
\r
<p>
\r
<ul>
\r
<li>
\r
<p>
\r
@@
-447,8
+447,8
@@
database. If you did exactly the steps above, you should now be able to do</p>
<pre><tt>.git/objects/55/7db03de997c86a4a028e1ebd3a1ceb225be238
\r
.git/objects/f2/4c74a2e500f5ee1332c86b94199f52b1d1d962</tt></pre>
\r
</div></div>
\r
<pre><tt>.git/objects/55/7db03de997c86a4a028e1ebd3a1ceb225be238
\r
.git/objects/f2/4c74a2e500f5ee1332c86b94199f52b1d1d962</tt></pre>
\r
</div></div>
\r
-<p>which correspond with the objects with names of
557db… and f24c7..
\r
-respectively.</p>
\r
+<p>which correspond with the objects with names of
<tt>557db…</tt> and
\r
+
<tt>f24c7…</tt>
respectively.</p>
\r
<p>If you want to, you can use <tt>git-cat-file</tt> to look at those objects, but
\r
you'll have to use the object name, not the filename of the object:</p>
\r
<div class="listingblock">
\r
<p>If you want to, you can use <tt>git-cat-file</tt> to look at those objects, but
\r
you'll have to use the object name, not the filename of the object:</p>
\r
<div class="listingblock">
\r
@@
-462,7
+462,7
@@
regular file), and you can see the contents with</p>
<div class="content">
\r
<pre><tt>$ git-cat-file "blob" 557db03</tt></pre>
\r
</div></div>
\r
<div class="content">
\r
<pre><tt>$ git-cat-file "blob" 557db03</tt></pre>
\r
</div></div>
\r
-<p>which will print out "Hello World". The object
557db03
is nothing
\r
+<p>which will print out "Hello World". The object
<tt>557db03</tt>
is nothing
\r
more than the contents of your file <tt>hello</tt>.</p>
\r
<div class="admonitionblock">
\r
<table><tr>
\r
more than the contents of your file <tt>hello</tt>.</p>
\r
<div class="admonitionblock">
\r
<table><tr>
\r
@@
-779,8
+779,8
@@
diff-index | V
</td>
\r
</tr></table>
\r
</div>
\r
</td>
\r
</tr></table>
\r
</div>
\r
-<p>More interestingly, you can also give <tt>git-diff-tree</tt> the <tt>
-v</tt> flag, which
\r
-tells it to also show the commit message and author and date of the
\r
+<p>More interestingly, you can also give <tt>git-diff-tree</tt> the <tt>
—pretty</tt> flag,
\r
+
which
tells it to also show the commit message and author and date of the
\r
commit, and you can tell it to show a whole series of diffs.
\r
Alternatively, you can tell it to be "silent", and not show the diffs at
\r
all, but just show the actual commit message.</p>
\r
commit, and you can tell it to show a whole series of diffs.
\r
Alternatively, you can tell it to be "silent", and not show the diffs at
\r
all, but just show the actual commit message.</p>
\r
@@
-1051,15
+1051,10
@@
and check out the state at that time.</p>
branch you happen to be on, a simple</p>
\r
<div class="listingblock">
\r
<div class="content">
\r
branch you happen to be on, a simple</p>
\r
<div class="listingblock">
\r
<div class="content">
\r
-<pre><tt>$ ls -l .git/HEAD</tt></pre>
\r
-</div></div>
\r
-<p>will tell you where it's pointing (Note that on platforms with bad or no
\r
-symlink support, you have to execute</p>
\r
-<div class="listingblock">
\r
-<div class="content">
\r
<pre><tt>$ cat .git/HEAD</tt></pre>
\r
</div></div>
\r
<pre><tt>$ cat .git/HEAD</tt></pre>
\r
</div></div>
\r
-<p>instead). To get the list of branches you have, you can say</p>
\r
+<p>will tell you where it's pointing. To get the list of branches
\r
+you have, you can say</p>
\r
<div class="listingblock">
\r
<div class="content">
\r
<pre><tt>$ git branch</tt></pre>
\r
<div class="listingblock">
\r
<div class="content">
\r
<pre><tt>$ git branch</tt></pre>
\r
@@
-1088,11
+1083,13
@@
that branch, and do some work there.</p>
<div class="content">
\r
<pre><tt>$ git checkout mybranch
\r
$ echo "Work, work, work" >>hello
\r
<div class="content">
\r
<pre><tt>$ git checkout mybranch
\r
$ echo "Work, work, work" >>hello
\r
-$ git commit -m 'Some work.' hello</tt></pre>
\r
+$ git commit -m 'Some work.'
-i
hello</tt></pre>
\r
</div></div>
\r
<p>Here, we just added another line to <tt>hello</tt>, and we used a shorthand for
\r
doing both <tt>git-update-index hello</tt> and <tt>git commit</tt> by just giving the
\r
</div></div>
\r
<p>Here, we just added another line to <tt>hello</tt>, and we used a shorthand for
\r
doing both <tt>git-update-index hello</tt> and <tt>git commit</tt> by just giving the
\r
-filename directly to <tt>git commit</tt>. The <tt>-m</tt> flag is to give the
\r
+filename directly to <tt>git commit</tt>, with an <tt>-i</tt> flag (it tells
\r
+git to <em>include</em> that file in addition to what you have done to
\r
+the index file so far when making the commit). The <tt>-m</tt> flag is to give the
\r
commit log message from the command line.</p>
\r
<p>Now, to make it a bit more interesting, let's assume that somebody else
\r
does some work in the original branch, and simulate that by going back
\r
commit log message from the command line.</p>
\r
<p>Now, to make it a bit more interesting, let's assume that somebody else
\r
does some work in the original branch, and simulate that by going back
\r
@@
-1108,7
+1105,7
@@
hasn't happened in the <tt>master</tt> branch at all. Then do</p>
<div class="content">
\r
<pre><tt>$ echo "Play, play, play" >>hello
\r
$ echo "Lots of fun" >>example
\r
<div class="content">
\r
<pre><tt>$ echo "Play, play, play" >>hello
\r
$ echo "Lots of fun" >>example
\r
-$ git commit -m 'Some fun.' hello example</tt></pre>
\r
+$ git commit -m 'Some fun.'
-i
hello example</tt></pre>
\r
</div></div>
\r
<p>since the master branch is obviously in a much better mood.</p>
\r
<p>Now, you've got two branches, and you decide that you want to merge the
\r
</div></div>
\r
<p>since the master branch is obviously in a much better mood.</p>
\r
<p>Now, you've got two branches, and you decide that you want to merge the
\r
@@
-1145,7
+1142,7
@@
file, which had no differences in the <tt>mybranch</tt> branch), and say:</p>
...
\r
Auto-merging hello
\r
CONFLICT (content): Merge conflict in hello
\r
...
\r
Auto-merging hello
\r
CONFLICT (content): Merge conflict in hello
\r
- Automatic merge failed
/prevented
; fix up by hand</tt></pre>
\r
+ Automatic merge failed; fix up by hand</tt></pre>
\r
</div></div>
\r
<p>which is way too verbose, but it basically tells you that it failed the
\r
really trivial merge ("Simple merge") and did an "Automatic merge"
\r
</div></div>
\r
<p>which is way too verbose, but it basically tells you that it failed the
\r
really trivial merge ("Simple merge") and did an "Automatic merge"
\r
@@
-1164,7
+1161,7
@@
Work, work, work</tt></pre>
<p>and once you're happy with your manual merge, just do a</p>
\r
<div class="listingblock">
\r
<div class="content">
\r
<p>and once you're happy with your manual merge, just do a</p>
\r
<div class="listingblock">
\r
<div class="content">
\r
-<pre><tt>$ git commit hello</tt></pre>
\r
+<pre><tt>$ git commit
-i
hello</tt></pre>
\r
</div></div>
\r
<p>which will very loudly warn you that you're now committing a merge
\r
(which is correct, so never mind), and you can write a small merge
\r
</div></div>
\r
<p>which will very loudly warn you that you're now committing a merge
\r
(which is correct, so never mind), and you can write a small merge
\r
@@
-1179,7
+1176,7
@@
have to do _that_ merge again.</p>
environment, is <tt>git show-branch</tt>.</p>
\r
<div class="listingblock">
\r
<div class="content">
\r
environment, is <tt>git show-branch</tt>.</p>
\r
<div class="listingblock">
\r
<div class="content">
\r
-<pre><tt>$ git show-branch master mybranch
\r
+<pre><tt>$ git show-branch
--topo-order
master mybranch
\r
* [master] Merge work in mybranch
\r
! [mybranch] Some work.
\r
--
\r
* [master] Merge work in mybranch
\r
! [mybranch] Some work.
\r
--
\r
@@
-1218,6
+1215,7
@@
would be different)</p>
<div class="listingblock">
\r
<div class="content">
\r
<pre><tt>Updating from ae3a2da... to a80b4aa....
\r
<div class="listingblock">
\r
<div class="content">
\r
<pre><tt>Updating from ae3a2da... to a80b4aa....
\r
+Fast forward
\r
example | 1 +
\r
hello | 1 +
\r
2 files changed, 2 insertions(+), 0 deletions(-)</tt></pre>
\r
example | 1 +
\r
hello | 1 +
\r
2 files changed, 2 insertions(+), 0 deletions(-)</tt></pre>
\r
@@
-2013,7
+2011,7
@@
to follow, not easier.</p>
</div>
\r
<div id="footer">
\r
<div id="footer-text">
\r
</div>
\r
<div id="footer">
\r
<div id="footer-text">
\r
-Last updated
30-Jan-2006 23:10:20 PDT
\r
+Last updated
07-Feb-2006 08:04:34 UTC
\r
</div>
\r
</div>
\r
</body>
\r
</div>
\r
</div>
\r
</body>
\r