<p dir="ltr">On 30 Jun 2015 10:01 p.m., "Robert C. Helling" <<a href="mailto:helling@atdotde.de">helling@atdotde.de</a>> wrote:<br>
> I second all of Dirk’s suggestions (of course, how could I?) and should maybe point out (as I learned this only very recently) that <br>
><br>
> git rebase —interactive<br>
><br>
> and<br>
><br>
> git add -p<br>
><br>
> are both extremely useful when rewriting history in order to make your patches look like you write perfect code right from the start.</p>
<p dir="ltr">I find that a soft git reset together with git gui is pretty useful as well. </p>
<p dir="ltr">First do a "git reset <sha>" (e.g. origin/master, if that's the upstream master branch) to uncommit and unstage your changes.  The changes are still on the filesystem.</p>
<p dir="ltr">Then do a "git gui". It will allow you to interactively stage lines and blocks of code into separate commits.  Very awesome!</p>
<p dir="ltr">Cheers,<br>
Henrik</p>