修改了git使用说明(中英文)

This commit is contained in:
baiyu 2013-08-19 20:04:32 +08:00
parent 9a3f362a47
commit 276a57695b
2 changed files with 355 additions and 277 deletions

View File

@ -15,8 +15,8 @@ body table tr td {
color: #333;
}
body table tr td {
color: #333;
font-size: 18px;
color: #000;
font-size: 20px;
font-family: "Comic Sans MS", cursive;
}
body table tr td span {
@ -29,6 +29,26 @@ body p {
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;
}
</style>
</head>
@ -44,33 +64,191 @@ body table tr td p {
</tr>
</table>
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span1>1、安装</span1></td>
</tr>
<tr>
<td>&nbsp;</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>&nbsp;</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>&nbsp;</td>
</tr>
</table>
<table width="456" border="0">
<tr>
<td width="450"><p ><span>Step1</span> </p></td>
</tr>
<tr>
<td><p >打开终端,输入如下命令:</p></td>
</tr>
<tr>
<td align="center"><p ><span>$git&nbsp;config&nbsp;--global&nbsp;user.name&nbsp;&#8220;your_name&#8221; </span></p>
<p></p>
<p ><span>$git&nbsp;config&nbsp;--global&nbsp;user.email&nbsp;&#8220;your_email&#8221;</span></p></td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p >用户名和email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到。 </p></td>
<td><p><span>Step3</span></p>
<p>在目录中右键单击TortoiseGit 再选Create Branch…就可以创建分支了。</p></td>
</tr>
</table>
<p>&nbsp;</p>
<table width="900" border="0">
<tr>
<td width="450"><span2>2、配置</span2></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><p >Tips </p></td>
<td><p >在桌面上点击鼠标右键选择TortoiseGit的Settings进行设置</p></td>
</tr>
<tr>
<td align="left">Name和Email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到。 </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>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><span2>3、日常用法</span2></td>
</tr>
</table>
<table width="200" border="0">
<tr>
<td>&nbsp;</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>完成上述操作后,可以看到工作区中出现了隐藏目录&nbsp;<span>.git</span>。这个隐藏的&nbsp;.git目录就是git版本库repository。 </p>
<p>&nbsp;</p>
<p><span>b</span>从远程服务器上克隆一个已存在的版本库到本地在目录中单击右键选择Git Clone... 然后在URL里填入要clone的文件的地址。</p></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p><span>Step2:</span></p>
<p>添加文件和文件夹</p>
<p>在文件夹中按右键, 选Git Commit -&gt; &quot;<span>master</span>&quot;… 接着填写Message, 勾选<span>Whole Project</span> 选项, 这样Commit 的时候可以将整个项目的信息全部Commit 上去, 可以实现不需要打Tag 就能Checkout 出每次Commit 的内容.</p>
<p>比如:</p>
<p>在工作区添加file1.txtcommit以后接着修改file1.txt再创建一个文件夹dir1, 并且放置一个file2.txt 在dir1 目<br />
录中, 再次commit 时, 就可以将dir1 和file2.txt 一起加入了.</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>创建分支</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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 >&nbsp;</p>
<p >Tips </p></td>
</tr>
<tr>
<td><p >在碰到不熟悉的命令时,可以通过&nbsp;<span>git&nbsp;help</span>命令查看git的用户手册命令如下 </p></td>
@ -81,147 +259,13 @@ body table tr td p {
<td width="291" align="center"><p ><span>$git&nbsp;help&nbsp;&lt;command&gt;</span> </p></td>
</tr>
</table>
<table width="899" border="0">
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><p ><span>Step2:</span> </p></td>
</tr>
<tr>
<td><p >创建版本库(两种途径) </p></td>
</tr>
</table>
<table width="899" border="0">
<tr>
<td><p >1从远程服务器上克隆一个已存在的版本库到本地 </p></td>
</tr>
</table>
<table width="522" border="0">
<tr>
<td width="516" align="center"><p ><span>$git&nbsp;clone&nbsp;http://user_name@domain/repo_path.git</span> </p></td>
</tr>
</table>
<table width="898" border="0">
<tr>
<td width="892"><p >其中domain是服务器的域名(在trustie系统域名222.247.54.100)repo_path.git是版本库在服务器的相对路径(这个地址在trustie系统中会给出) </p></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><p >2在本地初始化一个版本库比如将版本库命名为&#8220;DEMO&#8221;,使用名为/path/to/my/workspace的目录作为个人的工作区根目录进入该目录后执行<span>git&nbsp;init</span>创建版本库。 </p></td>
</tr>
</table>
<table width="327" border="0" align="left">
<tr>
<td width="321"><p ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cd&nbsp;/path/to/my/workspace </span></p></td>
</tr>
<tr>
<td><p ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$mkdir&nbsp;demo</span> </p></td>
</tr>
<tr>
<td><p ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cd&nbsp;demo </span></p></td>
</tr>
<tr>
<td><p ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$git&nbsp;init&nbsp; </span></p></td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="898" border="0">
<tr>
<td><p >完成上述操作后,可以看到<span>git&nbsp;init</span>命令在工作区创建了隐藏目录&nbsp;<span>.git</span>。这个隐藏的&nbsp;.git目录就是git版本库repository。 </p></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><p ><span>Step3</span> </p></td>
</tr>
<tr>
<td><p >提交文件到本地仓库: </p></td>
</tr>
</table>
<table width="258" border="0">
<tr>
<td width="252" align="center"><p ><span>$git&nbsp;add&nbsp;file1&nbsp;file2&nbsp; </span></p></td>
</tr>
</table>
<table width="897" border="0">
<tr>
<td><p >files是做了修改的文件多个文件使用空格隔开。 </p></td>
</tr>
</table>
<table width="386" border="0">
<tr>
<td width="380" align="center"><p ><span>$git&nbsp;commit&nbsp;&#8211;m&nbsp;&quot;commit&nbsp;message&quot;&nbsp; </span></p></td>
</tr>
</table>
<table width="897" border="0">
<tr>
<td width="891"><p >通过<span>-m</span>参数设置提交说明为&#8220;<span>commit&nbsp;message</span>&#8221;Git强制性的要求在提交过程中需要输入提交说明可以使用<span>git&nbsp;log</span>命令来查看提交日志。 </p></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><p ><span>Step4</span> </p></td>
</tr>
<tr>
<td><p >将本地分支推送到远程仓库: </p></td>
</tr>
<tr>
<td><p >上述操作仅仅是在本地建立了一个git版本库为了协同工作我们可以将其推送到远程服务器。 </p></td>
</tr>
</table>
<table width="610" border="0">
<tr>
<td width="604" align="center"><p ><span>$git&nbsp;remote&nbsp;add&nbsp;origin&nbsp;http://user_name@domain/repo_path.git&nbsp;</span> </p></td>
</tr>
</table>
<table width="896" border="0">
<tr>
<td><p >远程库别名为<span>origin</span> </p></td>
</tr>
</table>
<table width="292" border="0">
<tr>
<td width="328" align="center"><p ><span>$git&nbsp;push&nbsp;origin&nbsp;master&nbsp; </span></p></td>
</tr>
</table>
<table width="895" border="0">
<tr>
<td width="485"><p >将本地的master分支推送到origin的master分支 </p></td>
</tr>
</table>
<table width="896" border="0">
<tr>
<td width="900">&nbsp;</td>
</tr>
</table>
<table width="894" border="0">
<tr>
<td><p ><span>Step5</span> </p></td>
</tr>
<tr>
<td><p >将远程仓库的分支更新到本地: </p></td>
</tr>
<tr>
<td><p >当项目小组有成员将其自己的代码推送到服务器,我们可以使用<span>git&nbsp;pull</span>&nbsp;(或者<span>git&nbsp;fetch</span>)获取更新后的代码。</p></td>
</tr>
</table>
<table width="279" border="0">
<tr>
<td width="273" align="center"><p ><span>$git&nbsp;pull&nbsp;origin&nbsp;master </span></p></td>
</tr>
</table>
<table width="893" border="0">
<tr>
<td><p >将远程库origin的master分支更新到本地的master分支 </p></td>
</tr>
</table>
<table width="891" border="0">
<table width="900" border="0">
<tr>
<td>&nbsp;</td>
</tr>

View File

@ -31,6 +31,20 @@ body table tr td p {
color: #333;
font-family: "Comic Sans MS", cursive;
}
body table tr td table tr td span1 {
color: #09c;
font-weight: bold;
}
body table tr td span1 {
color: #09c;
font-weight: bold;
}
span3 {
color: #6C6;
}
span4 {
color: #F00;
}
</style>
</head>
@ -48,190 +62,208 @@ body table tr td p {
<table width="456" border="0">
<tr>
<td>&nbsp;</td>
<td><table width="200" border="0">
<tr>
<td>&nbsp;</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 >Enter the following command in the terminal</p></td>
<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="center"><p ><span>$git&nbsp;config&nbsp;--global&nbsp;user.name&nbsp;&#8220;your_name&#8221; </span></p>
<p></p>
<p ><span>$git&nbsp;config&nbsp;--global&nbsp;user.email&nbsp;&#8220;your_email&#8221;</span></p></td>
<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="898" border="0">
<tr>
<td><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). </p></td>
</tr>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p >Tips </p></td>
</tr>
<tr>
<td><p >You can read the user manual by enter "&nbsp;<span>git&nbsp;help</span> " command when you are confused, command as follows: </p></td>
<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="297" border="0">
<tr>
<td width="291" align="center"><p ><span>$git&nbsp;help&nbsp;&lt;command&gt;</span> </p></td>
</tr>
</table>
<table width="898" border="0">
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p ><span>Step2:</span> </p></td>
</tr>
<tr>
<td><p >Create a new repository by two ways, here we go </p></td>
<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="898" border="0">
<tr>
<td><p >(1)&nbsp;The first way is clone a repository which is already exists from remote Server to local: </p></td>
</tr>
</table>
<table width="522" border="0">
<tr>
<td width="516" align="center"><p ><span>$git&nbsp;clone&nbsp;http://user_name@domain/repo_path.git</span> </p></td>
</tr>
</table>
<table width="898" border="0">
<tr>
<td width="892"><p > The "domain" in the command means the server's domain name(the domain name in Trustie system is 222.247.54.100), "repo_path.git" is the relative path(this address will be given in Trustie) </p></td>
</tr>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p >(2)&nbsp;Initialize a repository on the local, we named repository as &#8220;DEMO&#8221; for example, use the directory "/path/to/my/workspace" as a root of personal workspace. </p></td>
<td><span1>2. Configuration</span1></td>
</tr>
</table>
<table width="898" border="0">
<table width="900" border="0">
<tr>
<td><p >Enter&nbsp;the&nbsp;directory,&nbsp;execute&nbsp;the&nbsp;&quot;<span>git&nbsp;init</span>&quot;&nbsp;command&nbsp;to&nbsp;create&nbsp;the&nbsp;repository.</p></td>
<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). </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="327" border="0" align="left">
<tr>
<td width="321"><p ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cd&nbsp;/path/to/my/workspace </span></p></td>
</tr>
<tr>
<td><p ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$mkdir&nbsp;demo</span> </p></td>
</tr>
<tr>
<td><p ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cd&nbsp;demo </span></p></td>
</tr>
<tr>
<td><p ><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$git&nbsp;init&nbsp; </span></p></td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="898" border="0">
<tr>
<td><p >After completed these operation, you can see "<span>git&nbsp;init</span> " command creates a hidden directory in the workspace and this hidden directory is the git repository. </p></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><p ><span>Step3</span> </p></td>
</tr>
<tr>
<td><p >Submit the file to the local repository: </p></td>
</tr>
</table>
<table width="258" border="0">
<tr>
<td width="252" align="center"><p ><span>$git&nbsp;add&nbsp;file1&nbsp;file2&nbsp; </span></p></td>
</tr>
</table>
<table width="898" border="0">
<tr>
<td><p >"file1" is the file which is already modified, multiple files separated by spaces. </p></td>
</tr>
</table>
<table width="388" border="0">
<tr>
<td width="380" align="center"><p ><span>$git&nbsp;commit&nbsp;&#8211;m&nbsp;&quot;commit&nbsp;message&quot;&nbsp; </span></p></td>
</tr>
</table>
<table width="898" border="0">
<tr>
<td width="891"><p >&#8220;<span>commit&nbsp;message</span>&#8221;is a submission instructions which is a mandatory requirement in the Git, you can use "<span>git&nbsp;log</span>" to list the commit log. </p></td>
</tr>
<table width="200" border="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="900" border="0">
<tr>
<td><p ><span>Step4</span> </p></td>
</tr>
<tr>
<td><p >Push the local branches to the remote repository: </p></td>
</tr>
<tr>
<td><p >The operation we mentioned above is only to establish a local git repository, we can push it to the remote server in order to work together in the future. </p></td>
<td><span1>3. Simple usage</span1></td>
</tr>
</table>
<table width="610" border="0">
<table width="900" border="0">
<tr>
<td width="604" align="center"><p ><span>$git&nbsp;remote&nbsp;add&nbsp;origin&nbsp;http://user_name@domain/repo_path.git&nbsp;</span> </p></td>
<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="898" border="0">
<table width="900" border="0">
<tr>
<td><p >In Git, we call remote repository as <span>origin</span> </p></td>
<td>&nbsp;</td>
</tr>
</table>
<table width="292" border="0">
<table width="900" border="0">
<tr>
<td width="328" align="center"><p ><span>$git&nbsp;push&nbsp;origin&nbsp;master&nbsp; </span></p></td>
<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="898" border="0">
<table width="200" border="0">
<tr>
<td width="485"><p >Push the local master branch to the origin master branch . </p></td>
<td>&nbsp;</td>
</tr>
</table>
<table width="898" border="0">
<table width="900" border="0">
<tr>
<td width="898">&nbsp;</td>
<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="898" border="0">
<table width="200" border="0">
<tr>
<td><p ><span>Step5</span> </p></td>
</tr>
<tr>
<td><p >Get the latest branch from the remote repository: </p></td>
</tr>
<tr>
<td><p >When your team members push the code to the server, we can use "<span>git&nbsp;pull</span>&nbsp;" (or "<span>git&nbsp;fetch</span>") to obtain the modified code.。</p></td>
<td>&nbsp;</td>
</tr>
</table>
<table width="279" border="0">
<table width="900" border="0">
<tr>
<td width="273" align="center"><p ><span>$git&nbsp;pull&nbsp;origin&nbsp;master </span></p></td>
<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="898" border="0">
<table width="200" border="0">
<tr>
<td><p >Pull the remote master branch to the local master branch.</p></td>
<td>&nbsp;</td>
</tr>
</table>
<table width="894" border="0">
<table width="900" border="0">
<tr>
<td width="888">&nbsp;</td>
<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 align="right">--By Trustie Team</td>
<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>&nbsp;</td>
</tr>
</table>
<table width="831" border="0">
<tr>
<td width="825" align="right">—— By Trustie Team</td>
</tr>
</table>
<p>&nbsp;</p>
@ -239,7 +271,9 @@ body table tr td p {
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<!-- end -->