git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry Potapov" <dpotapov@gmail.com>
To: "Jakub Narebski" <jnareb@gmail.com>
Cc: "Neshama Parhoti" <pneshama@gmail.com>, git@vger.kernel.org
Subject: Re: git push requires a subsequent git reset --hard ?
Date: Wed, 2 Jul 2008 17:45:11 +0400	[thread overview]
Message-ID: <37fcd2780807020645h463cf232oba7886cda6d7a768@mail.gmail.com> (raw)
In-Reply-To: <m3vdzpfr16.fsf@localhost.localdomain>

On Tue, Jul 01, 2008 at 10:29:38AM -0700, Jakub Narebski wrote:
>_
> This is considered normal.  Push would never touch index nor working
> area (although if you are the only user, and you know what you are
> doing, you can add "git reset --hard HEAD" to post-receive hook).

Doing "reset --hard" makes all your uncommitted changes to be lost.
OTOH, if you push on the local branch associated with HEAD then
recovering all uncommitted changes later will not be easy either. So,
I wonder, if git push should require --force to push to HEAD of a
non-bare repository. It will be at least some warning (especially for
novices) to not to do that, and those who understand what they are
doing can use --force.

Dmitry

      parent reply	other threads:[~2008-07-02 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01 16:51 git push requires a subsequent git reset --hard ? Neshama Parhoti
2008-07-01 17:19 ` Jeff King
2008-07-01 17:29 ` Jakub Narebski
2008-07-02 13:36   ` Dmitry Potapov
2008-07-04 13:25     ` Neshama Parhoti
2008-07-02 13:45   ` Dmitry Potapov [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=37fcd2780807020645h463cf232oba7886cda6d7a768@mail.gmail.com \
    --to=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=pneshama@gmail.com \
    /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).