parent
d22234dfe4
commit
e054f8045c
|
@ -1,12 +0,0 @@
|
|||
#added by baiyu
|
||||
class GitUsageController < ApplicationController
|
||||
layout "new_base"
|
||||
def ch_usage
|
||||
|
||||
end
|
||||
|
||||
def en_usage
|
||||
|
||||
end
|
||||
end
|
||||
#end
|
|
@ -1,352 +0,0 @@
|
|||
|
||||
<!-- 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;
|
||||
}
|
||||
body table tr td {
|
||||
color: #333;
|
||||
}
|
||||
body table tr td {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
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;
|
||||
}
|
||||
body table tr td span1 {
|
||||
color: #09C;
|
||||
font-weight: bold;
|
||||
}
|
||||
body table tr td span2 {
|
||||
font-weight: bold;
|
||||
color: #09C;
|
||||
}
|
||||
body table tr td p span3 {
|
||||
color: #6C6;
|
||||
}
|
||||
body table tr td p span3 {
|
||||
font-weight: bold;
|
||||
}
|
||||
body table tr td p span4 {
|
||||
color: #F00;
|
||||
}
|
||||
body table tr td p span4 {
|
||||
font-weight: bold;
|
||||
}
|
||||
body table tr td span5 {
|
||||
color: #F00;
|
||||
}
|
||||
body table tr td span5 {
|
||||
font-weight: bold;
|
||||
}
|
||||
body table tr td p span6 {
|
||||
color: #33F;
|
||||
font-weight: bold;
|
||||
}
|
||||
body table tr td span6 {
|
||||
color: #33F;
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body><table width="896" border="0">
|
||||
<tr>
|
||||
<th width="890" align="center" valign="middle"> Git使用说明</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="892" border="0">
|
||||
<tr>
|
||||
<td width="886">我们将使用 <span>git</span> 这个分布式版本控制系统来提交代码,下面就来介绍一下代码的提交方法。</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p> </p>
|
||||
<p><span6>Windows</span6></p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><span1>1、安装</span1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><span>Step1:</span></p>
|
||||
<p>到<a href="http://code.google.com/p/msysgit" >http://code.google.com/p/msysgit</a>下载<span>msysgit</span>, 我们使用的版本是Git-1.7.4-preview20110204.exe</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td>安装时,选择Checkout as-is, commit as-is,这样Git 就不会修改换行风格了. 其他用缺省设置即可。</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><span>Step2:</span></p>
|
||||
<p>到<a href="http://code.google.com/p/tortoisegit/" >http://code.google.com/p/tortoisegit/</a>下载<span>TortoiseGit</span>,我们使用的版本是Tortoisegit-1.6.5.0-32bit.msi</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>安装时, 选择TortoisePLink。</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td>这两个软件安装完成后, 就可以开始使用了。</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p><span>Step3:</span></p>
|
||||
<p>在目录中右键单击TortoiseGit 再选Create Branch…就可以创建分支了。</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td width="450"><span2>2、配置</span2></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p >在桌面上点击鼠标右键,选择TortoiseGit的Settings进行设置</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到,<span5> 其中的name和email要和<%= Setting.host_name %>上的登陆名和邮箱保持一致</span5>
|
||||
,方便代码贡献统计 )。 </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><p >接着可以定制上下文菜单:</p>
|
||||
<p >我们在Context Menu里勾选的是 <span>Clone</span>、<span>Sync</span>和<span>Commit</span></p>
|
||||
<p >在Set Extend Menu Item里勾选的是<span>Import Svn Ignore</span>、<span>Show Reflog</span>、<span>Browse References</span>、<span>Stash Apply</span>和<span>Submodule Sync</span></p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><span2>3、日常用法</span2></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p><span>Step1:</span></p>
|
||||
<p>创建版本库(两种途径)</p>
|
||||
<p><span>(a)</span>在文件夹中按右键, 选择Git Create repository here 就可以创建库了,在出现的窗口中, 不勾选选项, 直接按OK。</p>
|
||||
<p>完成上述操作后,可以看到工作区中出现了隐藏目录 <span>.git</span>。这个隐藏的 .git目录就是git版本库(repository)。 </p>
|
||||
<p> </p>
|
||||
<p><span>(b)</span>从远程服务器上克隆一个已存在的版本库到本地:在目录中单击右键,选择Git Clone... 然后在URL里填入要clone的文件的地址。</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p><span>Step2:</span></p>
|
||||
<p>添加文件和文件夹</p>
|
||||
<p>在文件夹中按右键, 选Git Commit -> "<span>master</span>"… ,接着填写Message, 勾选<span>Whole Project</span> 选项, 这样Commit 的时候可以将整个项目的信息全部Commit 上去, 可以实现不需要打Tag 就能Checkout 出每次Commit 的内容.</p>
|
||||
<p>比如:</p>
|
||||
<p>在工作区添加file1.txt,commit以后接着修改file1.txt,再创建一个文件夹dir1, 并且放置一个file2.txt 在dir1 目<br />
|
||||
录中, 再次commit 时, 就可以将dir1 和file2.txt 一起加入了.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p><span>Step3:</span></p>
|
||||
<p>创建分支</p>
|
||||
<p>在目录中单击右键,选择TortoiseGit 里的<span>create Branch…</span>就可以创建分支了。</p>
|
||||
<p>勾选<span>Switch to new branch</span>, 就可以跳转到建立好的分支上。</p>
|
||||
<p>比如:</p>
|
||||
<p>添加一个file3.txt 后, commit 修改。接着通<span>过Switch/Checkout…</span>.可以切换回master 分支。</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p><span>Step4:</span></p>
|
||||
<p>看分支情况及修改log</p>
|
||||
<p>在目录中单击右键,选择TortoiseGit 里的<span>Show log</span>, 可以看分支情况和修改log。 勾选<span>All Branches </span>可以看到所有分支的情况.</p>
|
||||
<p>在Message 列中,<span3> 绿色</span3>
|
||||
的是<span3>分支</span3>,<span4> 红色</span4>
|
||||
的是<span4>当前工作分支</span4>。</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p><span>Step5:</span></p>
|
||||
<p>比较版本差异</p>
|
||||
<p>通过按Shift , 可以选中两个版本, 接着再按鼠标右键, 选中<span>Compare revisions</span>, 就可以比较两个revision 了。</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p><span>Step6:</span></p>
|
||||
<p>合并分支</p>
|
||||
<p>首先切换到master 分支, 接着点击鼠标右键选择TortoiseGit 里的<span>Merge</span>,就可以实现将分支合并到主版本。</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p><span>Step7:</span></p>
|
||||
<p>其他操作</p>
|
||||
<p><span>(a)</span> Stash</p>
|
||||
<p>Git 提供了一个暂存修改的功能, 称为<span>Stash</span>。 在一些程序进行了修改, 但还不<br />
|
||||
想commit 成revision 时, 就可以将这些修改Stash 起来, 等到后面需要时再将它<br />
|
||||
们Pop 出来。</p>
|
||||
<p><span>(b)</span> 忽略文件</p>
|
||||
<p>一些编辑器在修改文件后会产生bak 文件, 一般不希望这些备份文件也加入<br />
|
||||
库中, 可以选中一个.bak 文件, 然后选择<span>Add to ignore list</span> 中的<span>*.bak</span>, 这样bak 文<br />
|
||||
件以后就不会被commit 了。</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p > </p>
|
||||
<p >Tips: </p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p >在碰到不熟悉的命令时,可以通过 <span>git help</span>命令查看git的用户手册,命令如下: </p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="297" border="0">
|
||||
<tr>
|
||||
<td width="291" align="center"><p ><span>$git help <command></span> </p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="901" border="0">
|
||||
<tr>
|
||||
<td width="895"><span6>Linux</span6></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><span1>1、安装</span1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>如果你用的是Linux,你可以用你的本地包管理系统(native package management system)来安装。</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><span>$ yum install git-core </span> </p>
|
||||
<p>在redhat等系统下用yum</p>
|
||||
<p><span>$apt-get install git-core</span></p>
|
||||
<p>在debian,ubuntu等系统下用apt-get</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span1>2、配置</span1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p ><span>$git config --global user.name “your_name”</span></p>
|
||||
<p><span>$git config --global user.email “your_email” </span> </p>
|
||||
<p>Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到,
|
||||
<span5> 其中的name和email要和<%= Setting.host_name %>上的登陆名和密码保持一致</span5>
|
||||
,方便代码贡献统计 )。</p></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span1>3、代码提交方法</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] [版本库里给的URL(去掉http)]</span></p>
|
||||
<p><span>$ git push [name] master</span></p>
|
||||
<p>输入password后即可上传。</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
<table width="831" border="0">
|
||||
<tr>
|
||||
<td width="825" align="right">——Trustie团队</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- end -->
|
|
@ -1,346 +0,0 @@
|
|||
<!-- 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> </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 "<span>Checkout as-is</span>" and "<span>commit as-is</span>" 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> </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 "TortoisePLink" 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> </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 "TortoiseGit" in the directory and check the "Create Branch… " option.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </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 "Settings" in the "TortoiseGit"</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 <%= Setting.host_name %></span5>
|
||||
). </p>
|
||||
<p>Then you can customize the "Context Menu":</p>
|
||||
<p>Please check the "<span>Clone</span>","<span>Sync</span>" and "<span>Commit</span>" options in the "<span>Context Menu</span>",</p>
|
||||
<p>check the "<span>Import Svn Ignore</span>", "<span>Show Reflog</span>", "<span>Browse References</span>", "<span>Stash Apply</span>" and "<span>Submodule Sync</span>" in the "<span>Set Extend Menu Item</span>".</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </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 "Git Create repository here". Uncheck any options in the new window, instead of it please click "OK".</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 " Git Clone.." and fill in the URL where you had clone from.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td> </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 -> "<span>master</span>"… , then fill in the "Message" and check the " <span> Whole Project </span> " 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 "file1.txt", commit it, and then creat a new folder in the workspace named "dir1", after that create a new file again, but this file is in the folder dir1, named "file2.txt". After that select "Git Commit", then file1 and dir1 can be joined together.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </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 -> "<span> create Branch… </span>".</p>
|
||||
<p>You will switch to the new branch when you check <span>"Switch to new branch" </span>option.</p>
|
||||
<p>For example:</p>
|
||||
<p>Create a new file in the workspace named "file3.txt", commit it. And you can switch to the "master" by select the "Switch/Checkout..." in the "TortoiseGit".</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </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 -> "<span> Show log</span>". Even you can also modify the log in it. And you can view all the branch's situation by check the " <span>All Branches </span> " option.</p>
|
||||
<p>In the "Message" 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> </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 "shift", and you can compare the different between two version by right-click the " <span>Compare revisions</span> ".</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </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 "master", then righr-click on it and select TortoiseGit -> "<span>Merge</span>" so that the branch can merge into the main version.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </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 ".bak" file and check the "<span>*.bak</span>" in the " <span>Add to ignore list</span>". Then the .bak files will not be commited.<br />
|
||||
</p>
|
||||
<p><br />
|
||||
</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="200" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td><p>Tips:</p>
|
||||
<p>You can read the user manual by enter " <span>git help</span> " 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 <command> </span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td> </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 "yum".</p>
|
||||
<p><span>$apt-get install git-core</span></p>
|
||||
<p>if you are using debian or ubuntu, you should type "apt-get".</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span1>2. Configuration</span1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><p><span>$git config --global user.name “your_name”M</span></p>
|
||||
<p><span>$git config --global user.email “your_email”</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 <%= Setting.host_name %></span5>
|
||||
). </p></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="900" border="0">
|
||||
<tr>
|
||||
<td> </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 website(with 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> </p>
|
||||
<table width="831" border="0">
|
||||
<tr>
|
||||
<td width="825" align="right">—— By Trustie Team</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
|
||||
<!-- end -->
|
|
@ -76,10 +76,7 @@
|
|||
<% end %>
|
||||
|
||||
<!-- added by bai -->
|
||||
<p class="fb c_dark mt10">查看如何提交代码:
|
||||
<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %>
|
||||
<%= link_to('English', en_usage_path, :class => "c_blue") %>
|
||||
|
||||
<p class="fb mt10"><a href="http://<%=Setting.host_name %>/forums/1/memos/1232" class=" c_blue ">点击查看如何提交代码</a></p>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
|
|
|
@ -257,9 +257,6 @@ RedmineApp::Application.routes.draw do
|
|||
match 'welcome/contest', :via => :get
|
||||
# end longjun
|
||||
|
||||
#added by baiyu
|
||||
match 'git_usage/ch_usage', :via => :get, :as => 'ch_usage'
|
||||
match 'git_usage/en_usage', :via => :get, :as => 'en_usage'
|
||||
#added by nie
|
||||
match '/projects/search', :via => [:get, :post]
|
||||
match '/users/search', :via => [:get, :post]
|
||||
|
|
Loading…
Reference in New Issue