git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Benjamin Buch <benni.buch@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: Deleted folder keeps showing up?
Date: Fri, 4 Sep 2009 04:27:09 -0400	[thread overview]
Message-ID: <20090904082708.GA17157@coredump.intra.peff.net> (raw)
In-Reply-To: <34230C98-81B8-4DC8-846F-8B6FA2A022DA@gmx.de>

On Thu, Sep 03, 2009 at 06:59:18PM +0200, Benjamin Buch wrote:

> I made a branch and deleted a folder there with git rm -rf foldername.
> So now i have to branches, A with the folder and B without the folder.
> 
> I'm on B, the folder is not there.
> Then I check out A, the folder shows up like it should.
> When I check out B again, the folder is still there.

Is there anything in the folder, like untracked files generated by your
build process? Remember that git tracks full paths, not directories. So
you never actually "deleted a folder" but rather deleted all of the
paths inside that folder.

When you switch to branch A, git creates the folder, because it contains
tracked files. When you switch back to branch B, git will remove the
tracked files, and will remove the directory _only_ if it is then empty.
Anything else would mean deleting your untracked files, which may be
precious.

You mentioned in a later email that you were having trouble reproducing
the issue.  Try:

  $ git checkout A
  $ make ;# or whatever your build process is, or
         ;# normal work or whatever
  $ git checkout B

and see if that reproduces it.

-Peff

      parent reply	other threads:[~2009-09-04  8:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-03 16:59 Deleted folder keeps showing up? Benjamin Buch
2009-09-04  7:41 ` Michael J Gruber
2009-09-04  8:18   ` Benjamin Buch
2009-09-04  8:36     ` Junio C Hamano
2009-09-07  8:17       ` Benjamin Buch
2009-09-04  8:27 ` Jeff King [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=20090904082708.GA17157@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=benni.buch@gmx.de \
    --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).