git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "git add sub1/ sub2/" doesn't work as expected when sub1 and sub2 has .git under them
@ 2009-01-12  8:36 Ping Yin
  0 siblings, 0 replies; only message in thread
From: Ping Yin @ 2009-01-12  8:36 UTC (permalink / raw)
  To: Git Mailing List

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-12  8:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12  8:36 "git add sub1/ sub2/" doesn't work as expected when sub1 and sub2 has .git under them Ping Yin

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).