<?xml version="1.0" encoding="UTF-8"?>
<guide>
  <body>&lt;p&gt;&lt;em&gt;Please, add your favorite cool and unusual Git techniques to this guide!&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;git add --patch&lt;/h2&gt;
&lt;p&gt;Lets you commit specific lines rather than whole files.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://tomayko.com/writings/the-thing-about-git&quot;&gt;The Thing About Git&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-add.html&quot;&gt;git add manpage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;git add --interactive&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;--interactive&lt;/code&gt; works very similar to &lt;code&gt;--patch&lt;/code&gt;, but gives you much more flexibility in choosing what (untracked) files and/or hunks you want to stage.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-add.html&quot;&gt;git add manpage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;git stash&lt;/h2&gt;
&lt;p&gt;Stash away the uncommited changes in your working directory to get a clean &lt;span class=&quot;caps&quot;&gt;HEAD&lt;/span&gt;.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-stash.html&quot;&gt;git stash manpage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Rebasing&lt;/h2&gt;
&lt;!-- I'm just guessing it is messy with forks, is it why we don't repush rebased commits? --&gt;&lt;p&gt;&lt;em&gt;Rebasing is neat for cleaning up commits, but you will generally &lt;strong&gt;not want to rebase already pushed commits&lt;/strong&gt; &amp;#8211; it becomes messy for others who are working on forks of your repository. If for some reason you really do want to repush rebased commits, you will need to &lt;code&gt;git push -f&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;git commit --amend&lt;/h3&gt;
&lt;p&gt;Add your changes to the last commit instead of a new one.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-commit.html&quot;&gt;git commit manpage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;git rebase --interactive&lt;/h3&gt;
&lt;p&gt;Rearrange, edit and squash commits.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://blog.madism.org/index.php/2007/09/09/138-git-awsome-ness-git-rebase-interactive&quot;&gt;git awesome-ness&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html&quot;&gt;git rebase manpage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;git cherry-pick&lt;/h2&gt;
&lt;p&gt;Want to grab only one commit from someone else&amp;#8217;s repository?  First fetch their changes and then apply the individual commit with &lt;code&gt;git cherry-pick 1111111&lt;/code&gt; (where 1111111 is the beginning of the sha1 hash of the commit you want to apply).&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html&quot;&gt;git cherry-pick manpage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</body>
  <created-at type="datetime">2008-04-09T00:32:50-07:00</created-at>
  <id type="integer">26</id>
  <permalink>cool-and-unusual-git-techniques</permalink>
  <title>Cool and unusual Git techniques</title>
  <updated-at type="datetime">2009-03-08T07:32:59-07:00</updated-at>
  <user-id type="integer">14644</user-id>
</guide>
