OSDN Git Service

Update create branch and tag document
authorFrank Li <lznuaa@gmail.com>
Thu, 18 Jun 2009 14:12:14 +0000 (22:12 +0800)
committerFrank Li <lznuaa@gmail.com>
Thu, 18 Jun 2009 14:12:14 +0000 (22:12 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
doc/images/en/Branch.png [new file with mode: 0644]
doc/images/en/Switch.png
doc/images/en/Tag.png [new file with mode: 0644]
doc/source/en/TortoiseGit/tsvn_dug/dug_branchtag.xml
doc/source/en/TortoiseGit/tsvn_dug/dug_chooseversion.xml [new file with mode: 0644]

diff --git a/doc/images/en/Branch.png b/doc/images/en/Branch.png
new file mode 100644 (file)
index 0000000..c1b22ac
Binary files /dev/null and b/doc/images/en/Branch.png differ
index bea48c1..2b4d6ae 100644 (file)
Binary files a/doc/images/en/Switch.png and b/doc/images/en/Switch.png differ
diff --git a/doc/images/en/Tag.png b/doc/images/en/Tag.png
new file mode 100644 (file)
index 0000000..855020e
Binary files /dev/null and b/doc/images/en/Tag.png differ
index 1a0dc3c..18beda3 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">\r
-<sect1 id="tsvn-dug-branchtag">\r
+<sect1 id="tsvn-dug-branchtag" xmlns:xi="http://www.w3.org/2001/XInclude">\r
        <title>Branching / Tagging</title>\r
        <indexterm>\r
                <primary>branch</primary>\r
                environment. This process is known as <firstterm>tagging</firstterm>.\r
        </para>\r
        <para>\r
-               Git does not have special commands for branching\r
-               or tagging, but uses so-called <quote>cheap copies</quote>\r
-               instead. Cheap copies are similar to hard links in Unix, which means\r
-               that instead of making a complete copy in the repository, an internal\r
-               link is created, pointing to a specific tree/revision. As a result\r
-               branches and tags are very quick to create, and take up almost\r
-               no extra space in the repository.\r
+               Git is very powerfull at branch and tag. It is very easy to Create branch\r
+               and tag. \r
        </para>\r
        <sect2 id="tsvn-dug-branch-1">\r
                <title>Creating a Branch or Tag</title>\r
                <para>\r
-                       If you have imported your project with the recommended\r
-                       directory structure, creating a branch or tag version is very simple:\r
+                       Creating a branch is very simple:\r
+                       <menuchoice>\r
+                               <guimenu>TortoiseGit</guimenu>\r
+                               <guimenuitem>Create Branch...</guimenuitem>\r
+                       </menuchoice>\r
                        <figure id="tsvn-dug-branchtag-dia-1">\r
-                               <title>The Branch/Tag Dialog</title>\r
-                               <graphic fileref="../images/Copy.png"/>\r
+                               <title>The Branch Dialog</title>\r
+                               <graphic fileref="../images/Branch.png"/>\r
                        </figure>\r
-                       Select the folder in your working copy which you want to copy\r
-                       to a branch or tag, then select the command\r
+               </para>\r
+               <para>\r
+                       Creating a tag is very simple:\r
                        <menuchoice>\r
                                <guimenu>TortoiseGit</guimenu>\r
-                               <guimenuitem>Branch/Tag...</guimenuitem>\r
-                       </menuchoice>.\r
+                               <guimenuitem>Create Tag...</guimenuitem>\r
+                       </menuchoice>\r
+                       \r
+                       <figure id="tsvn-dug-branchtag-dia-2">\r
+                               <title>The Tag Dialog</title>\r
+                               <graphic fileref="../images/Tag.png"/>\r
+                       </figure>\r
+                       \r
+               </para>\r
+               <para>\r
+                       <guilabel>branch</guilabel> input your branch name. \r
                </para>\r
                <para>\r
-                       The default destination URL for the new branch\r
-                       will be the source URL on which your working copy is based.\r
-                       You will need to edit that URL to the new path for your branch/tag.\r
-                       So instead of\r
-<screen>\r
-    http://svn.collab.net/repos/ProjectName/trunk\r
-</screen>\r
-                       you might now use something like\r
-<screen>\r
-    http://svn.collab.net/repos/ProjectName/tags/Release_1.10\r
-</screen>\r
-                       If you can't remember the naming convention you used last time,\r
-                       click the button on the right to open the repository browser\r
-                       so you can view the existing repository structure.\r
+                       <guilabel>tag</guilabel> input your tag name. \r
                </para>\r
                <para>\r
-                       Now you have to select the source of the copy. Here you have\r
-                       three options:\r
-                       <variablelist>\r
-                               <varlistentry>\r
-                                       <term>HEAD revision in the repository</term>\r
-                                       <listitem>\r
-                                               <para>\r
-                                               The new branch is copied directly in the repository\r
-                                               from the HEAD revision. No data needs to be transferred\r
-                                               from your working copy, and the branch is created\r
-                                               very quickly.\r
-                                               </para>\r
-                                       </listitem>\r
-                               </varlistentry>\r
-                               <varlistentry>\r
-                                       <term>Specific revision in the repository</term>\r
-                                       <listitem>\r
-                                               <para>\r
-                                               The new branch is copied directly in the repository\r
-                                               but you can choose an older revision. This is useful\r
-                                               if you forgot to make a tag when you released your\r
-                                               project last week. If you can't remember the revision\r
-                                               number, click the button on the right to show the\r
-                                               revision log, and select the revision number from\r
-                                               there. Again no data is transferred from your working\r
-                                               copy, and the branch is created very quickly.\r
-                                               </para>\r
-                                       </listitem>\r
-                               </varlistentry>\r
-                               <varlistentry>\r
-                                       <term>Working copy</term>\r
-                                       <listitem>\r
-                                               <para>\r
-                                               The new branch is an identical copy of your local\r
-                                               working copy. If you have updated some files to an\r
-                                               older revision in your WC, or if you have made local\r
-                                               changes, that is exactly what goes into the copy.\r
-                                               Naturally this sort of complex tag may involve\r
-                                               transferring data from your WC back to the repository\r
-                                               if it does not exist there already.\r
-                                               </para>\r
-                                       </listitem>\r
-                               </varlistentry>\r
-                       </variablelist>\r
+                       You can choose one commit that base on. \r
+                       <xi:include href="./dug_chooseversion.xml"/> \r
                </para>\r
+               \r
                <para>\r
                        If you want your working copy to be switched to the newly created\r
                        branch automatically, use the\r
-                       <guilabel>Switch working copy to new branch/tag</guilabel> checkbox.\r
+                       <guilabel>Switch to new branch/tag</guilabel> checkbox.\r
                        But if you do that, first make sure that your working copy does not\r
                        contain modifications. If it does, those changes will be merged into\r
                        the branch WC when you switch.\r
                </para>\r
                <para>\r
-                       Press <guibutton>OK</guibutton> to commit the new copy to the\r
-                       repository. Don't forget to supply a log message. Note that the\r
-                       copy is created <emphasis>inside the repository</emphasis>.\r
+                       Press <guibutton>OK</guibutton> to create branch or tag at  \r
+                       <emphasis>local repository</emphasis>.\r
                </para>\r
                <para>\r
                        Note that unless you opted to switch your working copy to the newly\r
                        created branch, creating a Branch or Tag does <emphasis>not</emphasis>\r
                        affect your working copy. Even if you create the branch from your WC,\r
-                       those changes are committed to the new branch, not to the trunk, so your\r
-                       WC may still be marked as modified with respect to the trunk.\r
-               </para>\r
-       </sect2>\r
-       <sect2 id="tsvn-dug-switch-1">\r
-               <title>To Checkout or to Switch...</title>\r
-               <?dbhh topicname="HIDD_SWITCH"?>\r
-               <indexterm>\r
-                       <primary>switch</primary>\r
-               </indexterm>\r
-               <para>\r
-                       ...that is (not really) the question. While a checkout downloads\r
-                       everything from the desired branch in the repository to your working\r
-                       directory,\r
-                       <menuchoice>\r
-                               <guimenu>TortoiseGit</guimenu>\r
-                               <guimenuitem>Switch...</guimenuitem>\r
-                       </menuchoice>\r
-                       only transfers the changed data to your\r
-                       working copy. Good for the network load, good for your patience. :-)\r
-               </para>\r
-               <para>\r
-                       To be able to work with your freshly generated branch or tag you\r
-                       have several ways to handle it. You can:\r
-                       <itemizedlist>\r
-                               <listitem>\r
-                                       <para>\r
-                                               <menuchoice>\r
-                                                       <guimenu>TortoiseGit</guimenu>\r
-                                                       <guimenuitem>Checkout</guimenuitem>\r
-                                               </menuchoice>\r
-                                               to make a fresh checkout in an empty folder.\r
-                                               You can check out to any location on your\r
-                                               local disk and you can create as many working copies\r
-                                               from your repository as you like.\r
-                                       </para>\r
-                               </listitem>\r
-                               <listitem>\r
-                                       <para>\r
-                                               Switch your current working copy to the\r
-                                               newly created copy in the repository. Again select the\r
-                                               top level folder of your project and use\r
-                                               <menuchoice>\r
-                                                       <guimenu>TortoiseGit</guimenu>\r
-                                                       <guimenuitem>Switch...</guimenuitem>\r
-                                               </menuchoice>\r
-                                               from the context menu.\r
-                                       </para>\r
-                                       <para>\r
-                                               In the next dialog enter the URL of the branch you just created.\r
-                                               Select the\r
-                                               <guilabel>Head Revision</guilabel>\r
-                                               radio button and click on\r
-                                               <guibutton>OK</guibutton>.\r
-                                               Your working copy is switched to the new branch/tag.\r
-                                       </para>\r
-                                       <para>\r
-                                               Switch works just like Update in that it never discards your\r
-                                               local changes. Any changes you have made to your working copy\r
-                                               which have not yet been committed will be merged when you\r
-                                               do the Switch. If you do not want this to happen then you\r
-                                               must either commit the changes before switching, or revert\r
-                                               your working copy to an already-committed revision (typically HEAD).\r
-                                       </para>\r
-                               </listitem>\r
-                               <listitem>\r
-                                       <para>\r
-                                               If you want to work on trunk and branch, but don't want\r
-                                               the expense of a fresh checkout, you can use Windows Explorer\r
-                                               to make a copy of your trunk checkout in another folder, then\r
-                                               <menuchoice>\r
-                                                       <guimenu>TortoiseGit</guimenu>\r
-                                                       <guimenuitem>Switch...</guimenuitem>\r
-                                               </menuchoice>\r
-                                               that copy to your new branch.\r
-                                       </para>\r
-                               </listitem>\r
-                       </itemizedlist>\r
-                       <figure id="tsvn-dug-switch-dia-1">\r
-                               <title>The Switch Dialog</title>\r
-                               <graphic fileref="../images/Switch.png"/>\r
-                       </figure>\r
+                       those changes are committed to the original branch, not to the new branch.\r
                </para>\r
                <para>\r
-                       Although Git itself makes no distinction between tags\r
-                       and branches, the way they are typically used differs a bit.\r
-                       <itemizedlist>\r
-                               <listitem>\r
-                                       <para>\r
-                                               Tags are typically used to create a static snapshot of the\r
-                                               project at a particular stage. As such they not normally\r
-                                               used for development - that's what branches are for, which\r
-                                               is the reason we recommended the\r
-                                               <filename>/trunk /branches /tags</filename>\r
-                                               repository structure in the first place. Working on a tag\r
-                                               revision is <emphasis>not a good idea</emphasis>, but\r
-                                               because your local files are not write protected there is\r
-                                               nothing to stop you doing this by mistake.\r
-                                               However, if you try to commit to a path in the repository\r
-                                               which contains <filename>/tags/</filename>, TortoiseGit will\r
-                                               warn you.\r
-                                       </para>\r
-                               </listitem>\r
-                               <listitem>\r
-                                       <para>\r
-                                               It may be that you need to make further changes to a\r
-                                               release which you have already tagged. The correct way\r
-                                               to handle this is to create a new branch from the tag\r
-                                               first and commit the branch. Do your Changes on this\r
-                                               branch and then create a new tag from this new branch, e.g. \r
-                                               <filename>Version_1.0.1</filename>.\r
-                                       </para>\r
-                               </listitem>\r
-                               <listitem>\r
-                                       <para>\r
-                                               If you modify a working copy created from\r
-                                               a branch and commit, then all changes go to the new\r
-                                               branch and <emphasis>not</emphasis> the trunk.\r
-                                               Only the modifications are stored.\r
-                                               The rest remains a cheap copy.\r
-                                       </para>\r
-                               </listitem>\r
-                       </itemizedlist>\r
+                       How to switch working copy to tag\branch,\r
+                       Please refer <xref linked="tsvn-dug-checkout"/> \r
                </para>\r
        </sect2>\r
+       \r
 </sect1>\r
diff --git a/doc/source/en/TortoiseGit/tsvn_dug/dug_chooseversion.xml b/doc/source/en/TortoiseGit/tsvn_dug/dug_chooseversion.xml
new file mode 100644 (file)
index 0000000..b6baac4
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE variablelist SYSTEM "../../../dtd/dblite.dtd">\r
+<variablelist>\r
+       <varlistentry>\r
+               <term><guilabel>HEAD</guilabel></term>\r
+               <listitem>\r
+                       <para>\r
+                               Current branch latest commit. \r
+                       </para>\r
+               </listitem>\r
+       </varlistentry>\r
+                               \r
+       <varlistentry>\r
+               <term><guilabel>Branch</guilabel></term>\r
+               <listitem>\r
+                       <para>\r
+                               The latest commit of chosen branch\r
+                       </para>\r
+               </listitem>\r
+       </varlistentry>\r
+       \r
+       <varlistentry>\r
+               <term><guilabel>Tags</guilabel></term>\r
+               <listitem>\r
+                       <para>\r
+                               The commit of chosen Tag\r
+                       </para>\r
+               </listitem>\r
+       </varlistentry>\r
+       \r
+       <varlistentry>\r
+               <term><guilabel>Version</guilabel></term>\r
+               <listitem>\r
+                       <para>\r
+                               Any commit, you click <guilabel>...</guilabel> to launch log\r
+                               dialog to choose commit. You also can input commit hash, or \r
+                               friend version name, such as HEAD~4. \r
+                       </para>\r
+               </listitem>\r
+       </varlistentry>\r
+       \r
+</variablelist>
\ No newline at end of file