<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kueda.net &#187; version control</title>
	<atom:link href="http://kueda.net/blog/tag/version-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://kueda.net</link>
	<description>I'm Back</description>
	<lastBuildDate>Thu, 26 Apr 2012 01:32:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Git Cheatsheet</title>
		<link>http://kueda.net/blog/2008/09/02/git-cheatsheet/</link>
		<comments>http://kueda.net/blog/2008/09/02/git-cheatsheet/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 03:32:23 +0000</pubDate>
		<dc:creator>Ken-ichi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://kueda.net/?p=117</guid>
		<description><![CDATA[It&#8217;s small, fast, and github is rad. So I am trying to learn it. # Setup git config --global --list git config --global user.name &#34;Ken-ichi&#34; git config --global user.email &#34;fortinbras@norway.net&#34; &#160; # The colors, children. Mm-hey git config --global color.diff auto git config --global color.status auto git config --global color.branch auto &#160; # Getting Info [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s small, fast, and github is rad.  So I am trying to learn it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Setup</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> <span style="color: #660033;">--list</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> user.name <span style="color: #ff0000;">&quot;Ken-ichi&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> user.email <span style="color: #ff0000;">&quot;fortinbras@norway.net&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># The colors, children.  Mm-hey</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> color.diff auto
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> color.status auto
<span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> color.branch auto
&nbsp;
<span style="color: #666666; font-style: italic;"># Getting Info</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> remote <span style="color: #660033;">-v</span> <span style="color: #666666; font-style: italic;"># Display the remote repository URL</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> log <span style="color: #666666; font-style: italic;"># duh</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> show COMMIT <span style="color: #666666; font-style: italic;"># equivalent of svn log -r REV_NUM, but with diffs</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Committing</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> add .
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-a</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Amending</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-a</span> <span style="color: #660033;">--amend</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Reverting</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> reset <span style="color: #660033;">--hard</span> HEAD <span style="color: #666666; font-style: italic;"># revert everything to HEAD</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> checkout path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #666666; font-style: italic;"># reset a single file</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Checking out previous states</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> checkout COMMIT
<span style="color: #c20cb9; font-weight: bold;">git</span> checkout master <span style="color: #666666; font-style: italic;"># to get back</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Stashing</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> stash <span style="color: #666666; font-style: italic;"># stash changes on this branch so you can switch and work on something else</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> stash pop <span style="color: #666666; font-style: italic;"># bring back the stashed changes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Pushing to another repos</span>
<span style="color: #666666; font-style: italic;"># could be local like /path/to/somewhere </span>
<span style="color: #666666; font-style: italic;"># or ssh://me@there.net/path/to/repos</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> push path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>repos
<span style="color: #c20cb9; font-weight: bold;">git</span> push origin master <span style="color: #666666; font-style: italic;"># if you cloned from a remote named origin</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># to switch origins</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> remote <span style="color: #c20cb9; font-weight: bold;">rm</span> origin
<span style="color: #c20cb9; font-weight: bold;">git</span> remote add origin <span style="color: #ff0000;">'path/to/a/bare/repo'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># note that when sharing a repo with others, you will all want to push/pull from a *bare* repo made with </span>
<span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #660033;">--bare</span> path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>repo
<span style="color: #666666; font-style: italic;"># See http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#public-repositories</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Branching and merging</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> branch new_branch <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">git</span> checkout new_branch <span style="color: #666666; font-style: italic;"># make a new branch and switch to it</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> checkout <span style="color: #660033;">-b</span> new_branch <span style="color: #666666; font-style: italic;"># same as above</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">diff</span> master..new_branch <span style="color: #666666; font-style: italic;"># diff two branches</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> merge other_branch
<span style="color: #c20cb9; font-weight: bold;">git</span> mergetool <span style="color: #660033;">-t</span> opendiff <span style="color: #666666; font-style: italic;"># resolve conflicts in a merge with FileMerge</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Adding a submodule</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> submodule init
<span style="color: #c20cb9; font-weight: bold;">git</span> submodule add path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>remote<span style="color: #000000; font-weight: bold;">/</span>repo path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>checkout
<span style="color: #c20cb9; font-weight: bold;">git</span> submodule update
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;I just added a submodule&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Updating a submodule</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>checkout
<span style="color: #c20cb9; font-weight: bold;">git</span> pull origin master <span style="color: #666666; font-style: italic;"># or wherever you're pulling from</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> ..<span style="color: #000000; font-weight: bold;">/</span>back<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>repo
<span style="color: #c20cb9; font-weight: bold;">git</span> submodule update
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;I just updated a submodule&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kueda.net/blog/2008/09/02/git-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

