Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As mentioned in the other answer comments, in practice each commit is unique and rewriting history will make new commits.</p> <p>You can think of it as cutting off the branches of a tree and then instantly growing new ones. They may even look the same but aren't. Yes, voodoo magic. In this analogy, <em>reverting</em> would be almost like supporting a falling branch with a log, so it will grow its way without falling down.</p> <p>That leads us to <a href="https://git-scm.com/book/en/v1/Git-Tools-Rewriting-History" rel="nofollow noreferrer">a couple good reasons to rewrite history</a>:</p> <ul> <li>Slim down a private repository before going public: for instance, create a new local private branch, test, test, rewrite, push.</li> <li>Remove sensitive data from a private repo before going public.</li> </ul> <p>Those already reveal what Greg already said: rewriting history <a href="https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#problems-With-rewriting-history" rel="nofollow noreferrer">will potentially screw up everyone</a> if the repository is public (pushed commits). Reason why I also advocate on avoid doing it at all costs even in private repos, just to keep the good habit: and so <strong>rewriting history should be avoided at all costs</strong> <sup>(this means to just give enough consideration before doing it: weight up the pros and cons!)</sup></p> <p>And there is at least another philosophical and overlooked reason: <strong>rewritten history is data lost</strong>. True, a git history with <code>revert</code> might look messier than a <code>reset</code> one. But if properly written, all that "mess" can be hidden away in separated branches and still we can see precisely at what point a revert was done. And even with reasons or evidence as to why it was done.</p> <p>Back to the tree analogy, even if you do remove the supporting log, the reverted branch will show the sinuous growing curves, and it is beautiful!</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. This table or related slice is empty.
    1. This table or related slice is empty.
    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