<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>
<td width="450"><p ><span>Step1:</span> </p></td>
</tr>
</tr>
<tr>
<tr>
<td> </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>
<tr>
<tr>
<td><p >Tips:</p></td>
<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>
</tr>
</table>
<table width="200" border="0">
<tr>
<tr>
<td><p >You can read the user manual by enter " <span>git help</span> " command when you are confused, command as follows: </p></td>
<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>
</tr>
</table>
</table>
<table width="898" border="0">
<table width="200" border="0">
<tr>
<tr>
<td> </td>
<td> </td>
</tr>
</tr>
</table>
<table width="900" border="0">
<tr>
<tr>
<td><p ><span>Step2:</span> </p></td>
<td><p><span>Step3:</span></p>
</tr>
<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>
<td><p >Create a new repository by two ways, here we go </p></td>
</tr>
</tr>
</table>
</table>
<table width="898" border="0">
<table width="200" border="0">
<tr>
<tr>
<td><p >(1) The first way is clone a repository which is already exists from remote Server to local: </p></td>
<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>
<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). </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>
</tr>
</table>
<table width="200" border="0">
<tr>
<tr>
<td> </td>
<td> </td>
</tr>
</tr>
<tr>
<td><p >(2) Initialize a repository on the local, we named repository as “DEMO” for example, use the directory "/path/to/my/workspace" as a root of personal workspace. </p></td>
<p>Create a new repository by two ways, here we go </p>
<tr>
<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>
</tr>
<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>
<td><p >After completed these operation, you can see "<span>git init</span> " command creates a hidden directory in the workspace and this hidden directory is the git repository. </p></td>
</tr>
<tr>
<tr>
<td> </td>
<td> </td>
</tr>
</tr>
<tr>
<td><p ><span>Step3:</span> </p></td>
</tr>
<tr>
<td><p >Submit the file to the local repository: </p></td>
<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>
</tr>
</table>
</table>
<table width="898" border="0">
<table width="200" border="0">
<tr>
<td width="891"><p >“<span>commit message</span>”is a submission instructions which is a mandatory requirement in the Git, you can use "<span>git log</span>" to list the commit log. </p></td>
</tr>
<tr>
<tr>
<td> </td>
<td> </td>
</tr>
</tr>
</table>
<table width="900" border="0">
<tr>
<tr>
<td><p ><span>Step4:</span> </p></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 -> "<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>
</tr>
</table>
<table width="200" border="0">
<tr>
<tr>
<td><p >Push the local branches to the remote repository: </p></td>
<td> </td>
</tr>
</tr>
</table>
<table width="900" border="0">
<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><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>
<td><p >In Git, we call remote repository as <span>origin</span> </p></td>
<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>
<td width="485"><p >Push the local master branch to the origin master branch . </p></td>
<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>
</tr>
</table>
</table>
<table width="898" border="0">
<table width="200" border="0">
<tr>
<tr>
<td width="898"> </td>
<td> </td>
</tr>
</tr>
</table>
</table>
<table width="898" border="0">
<table width="900" border="0">
<tr>
<tr>
<td><p ><span>Step5:</span> </p></td>
<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>
</tr>
</table>
<table width="200" border="0">
<tr>
<tr>
<td><p >Get the latest branch from the remote repository: </p></td>
<td> </td>
</tr>
</tr>
</table>
<table width="900" border="0">
<tr>
<tr>
<td><p >When your team members push the code to the server, we can use "<span>git pull</span> " (or "<span>git fetch</span>") to obtain the modified code.。</p></td>
<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>