bigdir/app/views/git_usage/en_usage.html.erb

347 lines
12 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- added by baiyu -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
body table tr th {
font-size: 24px;
color: #666;
font-family: "Comic Sans MS", cursive;
}
body table tr td {
color: #333;
}
body table tr td {
color: #333;
font-size: 18px;
font-family: "Comic Sans MS", cursive;
}
body table tr td span {
color: #039;
}
body p {
font-size: 18px;
color: #009;
}
body table tr td p {
color: #333;
font-family: "Comic Sans MS", cursive;
font-weight: normal;
}
body table tr td table tr td span1 {
color: #09c;
}
body table tr td span1 {
color: #09c;
font-weight: bold;
}
span3 {
color: #6C6;
}
span4 {
color: #F00;
}
body table tr td p span5 {
color: #F00;
}
body table tr td p span5 {
font-weight: bold;
}
body table tr td table tr td span6 {
color: #33F;
font-weight: bold;
font-size: 24px;
}
body table tr td span6 {
color: #33F;
font-weight: bold;
font-size: 24px;
}
</style>
</head>
<body><table width="898" border="0">
<tr>
<th width="890" align="center" valign="middle"> Git User Guide</th>
</tr>
</table>
<table width="892" border="0">
<tr>
<td width="886">We will use <span>git</span> which is a distributed version control and source code management system to submit our code, here is the submission method.</td>
</tr>
</table>
<table width="456" border="0">
<tr>
<td><table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span6>Windows</span6></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span1>1. Installation</span1></td>
</tr>
</table></td>
</tr>
<tr>
<td width="450"><p ><span>Step1</span> </p></td>
</tr>
<tr>
<td><p >Download <span>msysgit</span> from <a href="http://code.google.com/p/msysgit">http://code.google.com/p/msysgit</a>, the version we have used is </p>
<p >Git-1.7.4-preview20110204.exe.</p></td>
</tr>
<tr>
<td align="left"><p >Please tick &quot;<span>Checkout as-is</span>&quot; and &quot;<span>commit as-is</span>&quot; options during installation so git does not modify the line feed style. Other options you can use the default settings.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step2:</span></p>
<p>Download <span>TortoiseGit</span> from <a href="http://code.google.com/p/tortoisegit/" >http://code.google.com/p/tortoisegit/</a>, the version we have used is </p>
<p>Tortoisegit-1.6.5.0-32bit.msi.</p>
<p>Please tick &quot;TortoisePLink&quot; option during installation.</p>
<p>You can start using Git when you complete the installation.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step3:</span></p>
<p>You can create a branch with method that right-click the &quot;TortoiseGit&quot; in the directory and check the &quot;Create Branch… &quot; option.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span1>2. Configuration</span1></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p>Right-click on the desktop and select the &quot;Settings&quot; in the &quot;TortoiseGit&quot;</p>
<p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository, <span5> the name and email must be the same with login name and email you registed in the forge.trustie.net</span5>
). </p>
<p>Then you can customize the &quot;Context Menu&quot;:</p>
<p>Please check the &quot;<span>Clone</span>&quot;,&quot;<span>Sync</span>&quot; and &quot;<span>Commit</span>&quot; options in the &quot;<span>Context Menu</span>&quot;,</p>
<p>check the &quot;<span>Import Svn Ignore</span>&quot;, &quot;<span>Show Reflog</span>&quot;, &quot;<span>Browse References</span>&quot;, &quot;<span>Stash Apply</span>&quot; and &quot;<span>Submodule Sync</span>&quot; in the &quot;<span>Set Extend Menu Item</span>&quot;.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span1>3. Simple usage</span1></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step1:</span></p>
<p>Create a new repository by two ways, here we go </p>
<p><span>(a) </span>You can create a repository by right-click in the folder and select &quot;Git Create repository here&quot;. Uncheck any options in the new window, instead of it please click &quot;OK&quot;.</p>
<p>After completed these operation, you can see there is a hidden directory ( <span>.git </span>) in the workspace and this hidden directory is the git repository. </p>
<p><span>(b)</span> Clone a exist version from the remote server to local: right-click in the folder and select &quot; Git Clone..&quot; and fill in the URL where you had clone from.</p></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step2:</span></p>
<p>Add the new file and folder</p>
<p> Right-click in the folder and select Git Commit -&gt; &quot;<span>master</span>&quot;… then fill in the &quot;Message&quot; and check the &quot; <span> Whole Project </span> &quot; option so that the whole information of the project can commit.</p>
<p>For example:</p>
<p>Create a new file in the workspace named &quot;file1.txt&quot;, commit it, and then creat a new folder in the workspace named &quot;dir1&quot;, after that create a new file again, but this file is in the folder dir1, named &quot;file2.txt&quot;. After that select &quot;Git Commit&quot;, then file1 and dir1 can be joined together.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step3:</span></p>
<p> Create a new Branch </p>
<p>You can create a new branch by right-click in the folder and select TortoiseGit -&gt; &quot;<span> create Branch… </span>&quot;.</p>
<p>You will switch to the new branch when you check <span>&quot;Switch to new branch&quot; </span>option.</p>
<p>For example:</p>
<p>Create a new file in the workspace named &quot;file3.txt&quot;, commit it. And you can switch to the &quot;master&quot; by select the &quot;Switch/Checkout...&quot; in the &quot;TortoiseGit&quot;.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step4:</span></p>
<p>View and modify the log</p>
<p>You can view the situation of the branch by right-click in the folder and select TortoiseGit -&gt; &quot;<span> Show log</span>&quot;. Even you can also modify the log in it. And you can view all the branch's situation by check the &quot; <span>All Branches </span> &quot; option.</p>
<p>In the &quot;Message&quot; colume, <span3>branch</span3> is
<span3>green</span3>
and the <span4>current branch</span4> is <span4>red</span4>
.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step5:</span></p>
<p>Compare the version</p>
<p>You can select two version in the same time by press &quot;shift&quot;, and you can compare the different between two version by right-click the &quot; <span>Compare revisions</span> &quot;.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step6:</span></p>
<p>Merge the branch</p>
<p>First, you should switch to the &quot;master&quot;, then righr-click on it and select TortoiseGit -&gt; &quot;<span>Merge</span>&quot; so that the branch can merge into the main version.</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step7:</span></p>
<p>Other operations</p>
<p><span>(a)</span> Stash</p>
<p>Git provides a function named <span>Stash </span>to temporarily store the revised programs. When you revise some programs but still do not want to commit them, you can stash these revised programs and pop them if you need them then.</p>
<p><span>(b) </span>Ignore Files</p>
<p>The editor will generate some .bak files after editing. If you do not want to add these .bak files to the repository you can select the &quot;.bak&quot; file and check the &quot;<span>*.bak</span>&quot; in the &quot; <span>Add to ignore list</span>&quot;. Then the .bak files will not be commited.<br />
</p>
<p><br />
</p></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p>Tips:</p>
<p>You can read the user manual by enter &quot;&nbsp;<span>git&nbsp;help</span> &quot; command when you are confused, command as follows: </p></td>
</tr>
</table>
<table width="307" border="0">
<tr>
<td width="301" align="center"><span> $git help &lt;command&gt; </span></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span6>Linux</span6></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span1>1.Installation</span1></td>
</tr>
<tr>
<td><p>If you are useing Linux, you can install git through native package management system.</p>
<p><span>$ yum install git-core</span></p>
<p>if you are using redhat, you should type &quot;yum&quot;.</p>
<p><span>$apt-get install git-core</span></p>
<p>if you are using debian or ubuntu, you should type &quot;apt-get&quot;.</p></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><span1>2. Configuration</span1></td>
</tr>
<tr>
<td><p><span>$git config --global user.name &ldquo;your_name&rdquo;M</span></p>
<p><span>$git config --global user.email &ldquo;your_email&rdquo;</span> </p>
<p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository,
<span5> the name and email must be the same with login name and email you registed in the forge.trustie.net</span5>
). </p></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><span1>3. How to commit</span1></td>
</tr>
<tr>
<td><p>cd file1</p>
<p><span>$ git add file1</span></p>
<p><span>$ git init</span></p>
<p><span>$ git commit -a</span></p>
<p><span>$ git remote add [name] [The URL which we give you in our websitewith out http]</span></p>
<p><span>$ git push [name] master</span></p>
<p>The last step is enter your password. </p></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="831" border="0">
<tr>
<td width="825" align="right">—— By Trustie Team</td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<!-- end -->