Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><em>If you're just looking for the easy solution for fixing up earlier commits, read the question! It explains it all. But since Elmarco was asking for a slick way, here we go:</em></p> <p>As of Git 1.7.0, there is an <code>--autosquash</code> option for <a href="https://www.kernel.org/pub/software/scm/git/docs/git-rebase.html" rel="nofollow"><code>rebase</code></a>, which does what you want. There is also the <code>--fixup</code> and <code>--squash</code> options for <a href="https://www.kernel.org/pub/software/scm/git/docs/git-commit.html" rel="nofollow"><code>commit</code></a> to make things easier. With some aliasing you can probably even get the whole thing into a single command.</p> <p>I'd suggest upgrading to the newest Git for maximum awesomeness:</p> <pre><code>git/Documentation/RelNotes $ grep -i -A1 autosquash\\\|fixup * 1.7.0.txt: * "git rebase -i" learned new action "fixup" that squashes the change 1.7.0.txt- but does not affect existing log message. -- 1.7.0.txt: * "git rebase -i" also learned --autosquash option that is useful 1.7.0.txt: together with the new "fixup" action. 1.7.0.txt- -- 1.7.3.txt: * "git rebase -i" peeks into rebase.autosquash configuration and acts as 1.7.3.txt: if you gave --autosquash from the command line. 1.7.3.txt- -- 1.7.4.txt: * "git commit" learned --fixup and --squash options to help later invocation 1.7.4.txt- of the interactive rebase. -- 1.7.4.txt: * "git rebase --autosquash" can use SHA-1 object names to name which 1.7.4.txt: commit to fix up (e.g. "fixup! e83c5163"). 1.7.4.txt- </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload