git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Ferris <shawn.ferris@gmail.com>
To: git@vger.kernel.org
Subject: .git ignored regardless of --git-dir value
Date: Fri, 18 Nov 2011 13:56:56 -0700	[thread overview]
Message-ID: <CAC2kKA_PZNDg_dPjWXKeFU4ZVpMas3PubZfSgTnfCfVPuNPdsA@mail.gmail.com> (raw)

Hi All --

Is it expected behavior to have the .git directory ignored, even after
specifying an alternate location with --git-dir? For example:

$ git --git-dir=.foo init
Initialized empty Git repository in /home/sferris/work/t/.foo/

$ mkdir .git
$ touch .git/filea

$ git --git-dir=.foo --work-tree=. add .

$ git --git-dir=.foo --work-tree=. status
# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#    new file:   .foo/HEAD
#    new file:   .foo/config
#    new file:   .foo/description
#    new file:   .foo/hooks/applypatch-msg.sample
#    new file:   .foo/hooks/commit-msg.sample
#    new file:   .foo/hooks/post-update.sample
#    new file:   .foo/hooks/pre-applypatch.sample
#    new file:   .foo/hooks/pre-commit.sample
#    new file:   .foo/hooks/pre-rebase.sample
#    new file:   .foo/hooks/prepare-commit-msg.sample
#    new file:   .foo/hooks/update.sample
#    new file:   .foo/index.lock
#    new file:   .foo/info/exclude
#
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#    deleted:    .foo/index.lock
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#    .foo/index
#    .foo/objects/

Notice that .foo was added, but .git was ignored. I would have
expected .foo to be ignored and .git to be added? (right, wrong or
indifferent..)

Thanks for any info!

Shawn

             reply	other threads:[~2011-11-18 20:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 20:56 Shawn Ferris [this message]
2011-11-18 21:26 ` .git ignored regardless of --git-dir value Junio C Hamano
2011-11-18 22:47   ` Junio C Hamano
2011-11-18 23:44     ` Shawn Ferris

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=CAC2kKA_PZNDg_dPjWXKeFU4ZVpMas3PubZfSgTnfCfVPuNPdsA@mail.gmail.com \
    --to=shawn.ferris@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).