Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If the offending commit is in a private repository, what you want to do is not a big deal. Rewriting published git history is irritating for your collaborators, so be sure removing this line is worth the cost.</p> <p>The <a href="http://schacon.github.com/git/git-rebase.html" rel="nofollow noreferrer"><code>git-rebase</code> documentation</a> has a helpful passage.</p> <blockquote> <pre><code>git rebase [...] [&lt;--onto newbase&gt;] [&lt;upstream&gt;] [&lt;branch&gt;] </code></pre> <p>A range of commits could also be removed with rebase. If we have the following situation:</p> <pre><code>E---F---G---H---I---J topicA </code></pre> <p>then the command</p> <pre><code>git rebase --onto topicA~5 topicA~3 topicA </code></pre> <p>would result in the removal of commits <em>F</em> and <em>G</em>:</p> <pre><code>E---H'---I'---J' topicA </code></pre> <p>This is useful if <em>F</em> and <em>G</em> were flawed in some way, or should not be part of <code>topicA</code>. Note that the argument to <code>--onto</code> and the <em>upstream</em> parameter can be any valid commit-ish.</p> </blockquote> <p>Assuming your history is linear and the offending commit is in your master branch, you can adapt the example above by running</p> <pre><code>git rebase --onto 1f020~ 1f020 master </code></pre> <p>For hairier situations, use interactive rebase. You may find it helpful to follow along with <a href="https://stackoverflow.com/a/2568581/123109">an example that merges two commits</a>, but instead of marking the commit with <code>s</code> for squash, remove the entire line to remove the commit from your history.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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