git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Avery Pennarun" <apenwarr@gmail.com>
To: "Matt Graham" <mdg149@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git reset --hard isn't resetting
Date: Wed, 6 Aug 2008 14:02:44 -0400	[thread overview]
Message-ID: <32541b130808061102q752076a8ydc02fef4e799491f@mail.gmail.com> (raw)
In-Reply-To: <1c5969370808060941q59cb8f7fhabee3ef3c5107715@mail.gmail.com>

On 8/6/08, Matt Graham <mdg149@gmail.com> wrote:
>  I'm using a git svn tree in Cygwin.  I tried doing an svn rebase and
>  got in some weird state with local changes I can't get rid of.  It's
>  not an issue w/ the same repository on my linux machine.
>
>  git reset --hard
>  toggles 4 files between capitalization.  The files don't appear to
>  have changed case in svn, but it's a huge repository and not easy to
>  determine with certainty.

Try:
   git log --name-only
to see which patches change which files.  It's a virtual certainty
that they were renamed in svn at some point.

git doesn't handle case-munging filesystems perfectly, and gets into
the situation you describe.  First, you need to figure out whether you
have files with *both* cases accidentally added to your index (if git
reset toggles the capitalization, this is almost certainly the case):

    git ls-tree HEAD

If you see the same files with different case, that's your problem.

Now just 'git rm' the ones with the case you don't want, and commit
the result.  (Do *not* use commit -a!)  'git status' will give you
some funny messages indicating that files you *didn't* 'git rm' have
gone away in the filesystem; it's true, of course, but don't worry
about that.  Now 'git reset --hard HEAD' and you should be okay.

I'm not really sure what git should do better in this case, although
the current behaviour is obviously a bit confusing.

Have fun,

Avery

  parent reply	other threads:[~2008-08-06 18:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 16:41 git reset --hard isn't resetting Matt Graham
2008-08-06 18:01 ` Dmitry Potapov
2008-08-06 18:02 ` Avery Pennarun [this message]
2008-08-08  1:06   ` Matt Graham
2008-08-08 14:40     ` Avery Pennarun
2008-08-09  8:08       ` Eric Wong

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=32541b130808061102q752076a8ydc02fef4e799491f@mail.gmail.com \
    --to=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mdg149@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).