Re: abouy git reset command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 13, 2008 at 8:07 AM, amishera <amishera2007@xxxxxxxxx> wrote:
> Moreover, can any body tell me the use of
>
> git reset --soft

Jakub answered about "git reset --soft" on its own, so I'll just
mention the situation I use, say, "git reset --soft HEAD~5" which is:
suppose you realise that you made a really bad mistake 5 commits ago
(say some obscure bug that could cause data loss) and you've just
discovered and fixed it in your working tree (checking in bits to the
index). You don't want to risk ever running a version of your program
built from any of those commits. What you really _ought_ to do is
essentially redo those 5 commits removing the bug, but depending how
rigorous and time constrained your development is you might just want
to commit your new fixed state with one big change log. "git reset
--soft HEAD~5" moves HEAD back five commits but leaves your working
tree and index alone, so the next "git commit" will commit your fixed
current state after the new HEAD. It's clearly not what you want to do
if you're working in a careful development team, but I find it useful
on rare occasions.

-- 
cheers, dave tweed__________________________
david.tweed@xxxxxxxxx
Rm 124, School of Systems Engineering, University of Reading.
"while having code so boring anyone can maintain it, use Python." --
attempted insult seen on slashdot
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux