From: "David Tweed" <david.tweed@gmail.com>
To: amishera <amishera2007@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: abouy git reset command
Date: Tue, 13 May 2008 13:34:56 +0100 [thread overview]
Message-ID: <e1dab3980805130534w42ce098qf2ffe2fc89fab98b@mail.gmail.com> (raw)
In-Reply-To: <17202423.post@talk.nabble.com>
On Tue, May 13, 2008 at 8:07 AM, amishera <amishera2007@gmail.com> 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@gmail.com
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
prev parent reply other threads:[~2008-05-13 12:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 7:07 abouy git reset command amishera
2008-05-13 8:33 ` Jakub Narebski
2008-05-13 12:34 ` David Tweed [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1dab3980805130534w42ce098qf2ffe2fc89fab98b@mail.gmail.com \
--to=david.tweed@gmail.com \
--cc=amishera2007@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).