Mercurial > hg-website
comparison hgscm/templates/quick_start.html @ 207:c1c9a4f809ba
integrated quick_start and learn_mercurial into the django project (with links).
Only missing parts: A wiki-page for links to learning resources and autodetection of the most current version.
author | Arne Babenhauserheide <bab@draketo.de> |
---|---|
date | Thu, 02 Jul 2009 15:35:27 +0200 |
parents | 3989294c82e4 |
children | 68d5f2b82018 |
comparison
equal
deleted
inserted
replaced
206:d3c0ba7f5284 | 207:c1c9a4f809ba |
---|---|
1 {% extends "base.html" %} | |
2 | |
3 {% load extras %} | |
4 {% block content %} | |
5 | |
6 <div class="row"> | |
7 <div class="col big"> | |
1 <h1>Quick Start</h1> | 8 <h1>Quick Start</h1> |
2 <p><em>How to get going at once.</em></p> | 9 <p><em>How to get going at once.</em></p> |
3 <h2>Part 0: Instant usage</h2> | 10 <h2>Part 0: Instant usage</h2> |
4 <p><em>(you know this from the main page)</em></p> | 11 <p><em>(you know this from the main page)</em></p> |
5 <p>Clone a project and create a patch </p> | 12 <p>Clone a project and create a patch </p> |
7 $ cd hello | 14 $ cd hello |
8 $ (edit files) | 15 $ (edit files) |
9 $ hg add (new files) | 16 $ hg add (new files) |
10 $ hg commit -m 'My changes' | 17 $ hg commit -m 'My changes' |
11 $ hg export tip > patch.diff | 18 $ hg export tip > patch.diff |
19 | |
12 </code></pre> | 20 </code></pre> |
13 <p>Create a project and commit </p> | 21 <p>Create a project and commit </p> |
14 <pre><code>$ hg init (project-directory) | 22 <pre><code>$ hg init (project-directory) |
15 $ cd (project-directory) | 23 $ cd (project-directory) |
16 $ (add some files) | 24 $ (add some files) |
29 </li><li>hg push: get all changes from your repository into another one | 37 </li><li>hg push: get all changes from your repository into another one |
30 </li><li>hg serve: create an instant-webserver. People can see the history there and pull from it | 38 </li><li>hg serve: create an instant-webserver. People can see the history there and pull from it |
31 </li><li>hg merge: join different lines of history | 39 </li><li>hg merge: join different lines of history |
32 </li> | 40 </li> |
33 </ul> | 41 </ul> |
34 <p>If you want to see a nice graph of the history, just do "hg serve" in your repository and then direct your browser to </p> | 42 <p>If you want to see a nice graph of the history, just do <hg>hg serve</hg> in your repository and then direct your browser to </p> |
35 <pre><code> http://127.0.0.1:8000 | 43 <pre><code> http://127.0.0.1:8000 |
44 | |
36 </code></pre> | 45 </code></pre> |
37 <p>This also helps getting a feeling for what the commands do. </p> | 46 <p>This also helps getting a feeling for what the commands do. </p> |
38 <p>(you can also do a lot of finegrained stuff by using different command options. Just call "hg help <command>" to see them). </p> | 47 <p>(you can also do a lot of finegrained stuff by using different command options. Just call "hg help <command>" to see them). </p> |
39 <p>One step you'll likely want to do is setting your username in your Mercurial config file. </p> | 48 <p>One step you'll likely want to do is setting your username in your Mercurial config file. </p> |
40 <p>For this you can configure a proper name and email address in ~/.hgrc (or on a Windows system in %USERPROFILE%Mercurial.ini) by adding lines such as the following: </p> | 49 <p>For this you can configure a proper name and email address in ~/.hgrc (or on a Windows system in %USERPROFILE%Mercurial.ini) by adding lines such as the following: </p> |
41 <pre><code>[ui] | 50 <pre><code>[ui] |
42 username = John Doe <john@example.com> | 51 username = John Doe <john@example.com> |
52 | |
43 </code></pre> | 53 </code></pre> |
44 <p>I you want more than this quick overview, please have a look at our longer <a href="{% url workflow_guide %}">practical guide</a>. </p> | 54 <p>I you want more than this quick overview, please have a look at our longer <a href="{% url workflow_guide %}">practical guide</a>. </p> |
45 <h2>Part 2: Understanding Mercurial in 6 steps</h2> | 55 <h2>Part 2: Understanding Mercurial in 6 steps</h2> |
46 <p>Now we'll look at some of the basic concepts of Mercurial to get a better understanding of its internals: </p> | 56 <p>Now we'll look at some of the basic concepts of Mercurial to get a better understanding of its internals: </p> |
47 <ol> | 57 <ol class="undecorated_list"> |
48 <li> | 58 <li> |
49 <p>Like in Subversion, history consists of a number of commits. They're | 59 <p>Like in Subversion, history consists of a number of commits. They're |
50 called changesets in Mercurial.</p> | 60 called changesets in Mercurial.</p> |
51 | 61 |
52 </li><li> | 62 </li><li> |
56 everybody agrees on the revision numbers.</p> | 66 everybody agrees on the revision numbers.</p> |
57 | 67 |
58 </li><li> | 68 </li><li> |
59 <p>Mercurial generalizes this by letting each changeset have multiple | 69 <p>Mercurial generalizes this by letting each changeset have multiple |
60 children. If I work alone and make commits I'll make</p> | 70 children. If I work alone and make commits I'll make</p> |
61 <p>C1 --> C2 --> C3</p> | 71 <pre><code>C1 --> C2 --> C3 |
72 | |
73 </code></pre> | |
62 <p>by making three commits. </p> | 74 <p>by making three commits. </p> |
63 | 75 |
64 <p>The commit C3 with no children is a "head". | 76 <p>The commit C3 with no children is a "head". |
65 It is also the newest changeset in the repository -- called "tip". If I shared C1 with you and you started your work from that, your | 77 It is also the newest changeset in the repository -- called "tip". If I shared C1 with you and you started your work from that, your |
66 commits will build a repository like this:</p> | 78 commits will build a repository like this:</p> |
67 <pre><code>C1 --> C2' --> C3' | 79 <pre><code>C1 --> C2' --> C3' |
80 | |
68 </code></pre> | 81 </code></pre> |
69 <p>Here C3' is a head in your repository and I don't know anything | 82 <p>Here C3' is a head in your repository and I don't know anything |
70 about C2' and C3' yet.</p> | 83 about C2' and C3' yet.</p> |
71 | 84 |
72 </li><li>If I pull from you, or you push to me, the two repositories are | 85 </li><li>If I pull from you, or you push to me, the two repositories are |
75 transfer the missing ones. | 88 transfer the missing ones. |
76 <p>After a pull from you my repository will look like this:</p> | 89 <p>After a pull from you my repository will look like this:</p> |
77 <pre><code> /-> C2 --> C3 | 90 <pre><code> /-> C2 --> C3 |
78 C1 -< | 91 C1 -< |
79 \-> C2' --> C3' | 92 \-> C2' --> C3' |
93 | |
80 </code></pre> | 94 </code></pre> |
81 <p>Here C1 has two child changesets, and the repository has two heads | 95 <p>Here C1 has two child changesets, and the repository has two heads |
82 since the development has diverged.</p> | 96 since the development has diverged.</p> |
83 <p>The changeset C3' will be the new tip since it is the newest | 97 <p>The changeset C3' will be the new tip since it is the newest |
84 changeset in the repository. Note that tip is always a head, but a | 98 changeset in the repository. Note that tip is always a head, but a |
93 merge must be committed and this creates a changeset which explains | 107 merge must be committed and this creates a changeset which explains |
94 to the world how you think the two heads should be combined:</p> | 108 to the world how you think the two heads should be combined:</p> |
95 <pre><code> /-> C2 --> C3 -\ | 109 <pre><code> /-> C2 --> C3 -\ |
96 C1 -< >-> M | 110 C1 -< >-> M |
97 \-> C2' --> C3' -/ | 111 \-> C2' --> C3' -/ |
112 | |
98 </code></pre> | 113 </code></pre> |
99 <p>Note that the merge changeset M has two parents.</p> | 114 <p>Note that the merge changeset M has two parents.</p> |
100 <p>If you do not merge C3 and C3' and try to push, you get the 'new | 115 <p>If you do not merge C3 and C3' and try to push, you get the 'new |
101 remote head' message and push aborts. It aborts since it is a little | 116 remote head' message and push aborts. It aborts since it is a little |
102 "impolite" to leave the job of merging to someone else -- he who | 117 "impolite" to leave the job of merging to someone else -- he who |
121 </ul> | 136 </ul> |
122 </ol> | 137 </ol> |
123 | 138 |
124 <p>And if you want to quickly look up something, you can use one of the <a href="http://www.selenic.com/mercurial/wiki/index.cgi/QuickReferenceCardsAndCheatSheets">Mercurial cheatsheets</a>. </p> | 139 <p>And if you want to quickly look up something, you can use one of the <a href="http://www.selenic.com/mercurial/wiki/index.cgi/QuickReferenceCardsAndCheatSheets">Mercurial cheatsheets</a>. </p> |
125 <p><em>Compiled from a great email by Martin Geisler.</em></p> | 140 <p><em>Compiled from a great email by Martin Geisler.</em></p> |
141 | |
142 </div> | |
143 <div class="col"> | |
144 {% download_button %} | |
145 {% mercurial_tricks %} | |
146 {% mercurial_tricks_advanced %} | |
147 </div> | |
148 </div> | |
149 | |
150 {% endblock %} |