Git For Windows
<h3 class="heading-h6"><a name="THLToolboxhomegtDevelopersZonegtGITforWindows" class="anchorpoint"></a><a href="/tools/wiki/home.html">THL Toolbox</a> > <a href="/tools/wiki/Developers%27%20Zone.html">Developers' Zone</a> > GIT for Windows</h3><p class="paragraph">
</p><h3 class="heading-h1"><a name="GITforWindows" class="anchorpoint"></a>GIT for Windows</h3><p class="paragraph"><strong class="bold">Contributor(s):</strong> Than Grove
</p><h3 class="heading-h2"><a name="InitialGITSetUp" class="anchorpoint"></a>Initial GIT Set Up</h3><ol><li>Install Git</li>
<li>Get an account on Github</li>
<li>Open local terminal window</li>
<li>Set up SSH Keys:<ol><li>Type: <div class="code"><pre>ssh-keygen -t rsa -C <span class="java-quote">"useremail@virginia.edu"</span></pre></div></li>
<li>Create pass phrase</li>
<li>In folder C:/Users/{Profile name}, open file called “id_rsa_pub” and copy contents to clipboard.</li>
<li>Go to GitHub Account Setting SSH Keys.</li>
<li>Click “Add Keys”.</li>
<li>Give it a descriptive name and paste in the key and save.</li></ol>
</li>
<li>Set global Git Config, by typing: <div class="code"><pre>git config --global user.name <span class="java-quote">"GIT Acct Name"</span>
git config --global user.email <span class="java-quote">"useremail@virginia.edu"</span></pre></div></li>
<li>Create a file in C:/Users/{Profile Name} called “.bashrc” with the following contents: <div class="code"><pre>eval `ssh-agent -t14400` (Note: 14400 = 4 hrs)
ssh-add</pre></div></li></ol><p class="paragraph">
</p><h3 class="heading-h2"><a name="AddingaRepo" class="anchorpoint"></a>Adding a Repo</h3><ol><li>Create repository on git hub. Say, for instance, it is called, “mycode”</li>
<li>Open Terminal. It should ask for your passphrase. Enter it and navigate to folder that will be the repo’s root, the “mycode” folder.</li>
<li>Type: git init</li>
<li>Type: git add .</li>
<li>Type: git commit –m “Initial Commit”</li>
<li>Type: git remote add origin git@github.com:GitAcctName/mycode.git</li>
<li>Type: git push origin master</li></ol><p class="paragraph">
</p><h3 class="heading-h2"><a name="InAptana" class="anchorpoint"></a>In Aptana</h3><p class="paragraph">After the initial GIT set up you can do much of the console commands in Aptana. With an existing folder, you can add it as a project within the Aptana project explorer:</p><ol><li>Open Project Explorer side pane</li>
<li>Right click on it and choose “Import”</li>
<li>Choose “Existing Folder as New Project” and click next.</li>
<li>Fill in the Promote to Project Page:<ol><li>Browse to select the root folder of project</li>
<li>Give it a project name (same as repo?)</li>
<li>Choose project type</li>
<li>Click “Finish”.</li></ol>
</li>
<li>Then open the terminal window and initialize the repo as in the “Adding Repo” section.</li>
<li>To connect an Aptana project to a Git repo, right click on the project root folder/name and choose Team Share Project.</li>
<li>After that the “Team” context menu will have the regular Git commands: Push, Pull, Stage, Commit, Status, etc.</li></ol><p class="paragraph">
</p><h3 class="heading-h6"><a name="ProvidedforunrestrictedusebythespanclassnobrimgsrcsakairwikitoolimagesicklearrowgifaltexternallinktitleexternallinkahrefhttpwwwthliborgtargetrwikiexternalTibetanandHimalayanLibraryaspan" class="anchorpoint"></a><em class="italic">Provided for unrestricted use by the <span class="nobr"><img src="/" alt="external link: " title="external link"/><a href="http://www.thlib.org" target="rwikiexternal">Tibetan and Himalayan Library</a></span></em></h3>