Re: bad git pull
From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:15
On Fri, 16 Dec 2005, Morten Welinder wrote:
It would be outright peachy if Documentation/git-commit.txt and Documentation/git-pull.txt mentioned these. That is certainly where I would look first to answer the "what if I screwed up?" question.
It might be even better to have some of the "safe" versions around. Ie something that refuses to "undo" a merge (you want to "unpull" it or "unmerge" it), and refuses to "undo" when there's a ORIG_HEAD around that implies that the last commit was a "pull" (in which case again "undo" may be the wrong thing to do, since it will only undo _one_ commit, even though the pull might have fast-forwarded a _lot_ of commits). Of course, if we do that, we should also make sure that "git commit" removes ORIG_HEAD. Or maybe "git commit" should always _write_ ORIG_HEAD with the old head, so that we can always do an "undo" by doing "git reset --hard ORIG_HEAD" regardless of whether the last thing was a "git commit" or a "git pull". Hmm? Linus