git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ping Yin" <pkufranky@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Subject: "git add sub1/ sub2/" doesn't work as expected when sub1 and sub2 has .git under them
Date: Mon, 12 Jan 2009 16:36:26 +0800	[thread overview]
Message-ID: <46dff0320901120036h97d4162ucd37c17b9dfb6217@mail.gmail.com> (raw)

Assume directories sub1 and sub2 have .git under them. "git add sub1/"
works as expected (files under sub1/ are added), howerver "git add
sub1/ sub2/" doesn't work as expeced (sub1 and sub2 are added as
submoudle).

$ git --version git version 1.6.0.4.617.g2baf1

# create repo super
$ mkdir super && cd super && git init && git commit --allow-empty -m
"Initial commit"

# create repo super/sub1 with file sub1-file
$ mkdir sub1 && cd sub1 && touch sub1-file
$ git init && git add . && git commit -m "Initial commit" && cd ..

# create repo super/sub2 with file sub2-file
$ mkdir sub2 && cd sub2 && touch sub2-file
$ git init && git add . && git commit -m "Initial commit" && cd ..

# to intend to add files under sub1 and sub2, but submodules are added
$ git add sub1/ sub2/
$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   sub1
#       new file:   sub2
#

$ git rm --cached sub1 sub2

# to intend add files under sub1, ok
$ gtad sub1/
$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   sub1/sub1-file
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       sub2/


Ping Yin

                 reply	other threads:[~2009-01-12  8:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=46dff0320901120036h97d4162ucd37c17b9dfb6217@mail.gmail.com \
    --to=pkufranky@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).