Files
git-mirror/Documentation
Ævar Arnfjörð Bjarmason 31991b0260 git submodule: add submodules with git add -f <path>
Change `git submodule add' to add the new submodule <path> with `git
add --force'.

I keep my /etc in .git with a .gitignore that contains just
"*". I.e. `git status' will ignore everything that isn't in the tree
already. When I do:

    git submodule add <url> hlagh

git-submodule will get as far as checking out the remote repository
into hlagh, but it'll die right afterwards when it fails to add the
new path:

    The following paths are ignored by one of your .gitignore files:
    hlagh
    Use -f if you really want to add them.
    fatal: no files added
    Failed to add submodule 'hlagh'

Currently there's no way to add a submodule in this situation other
than to remove the ignored path from the .gitignore while I'm at it.

That's silly, when you run `git submodule add' you're explicitly
saying that you want to add something *new* to the repository. Instead
it should just add the path with `git add --force'.

Initially I implemented this by adding new -f and --force options to
`git submodule add'. But if the --force option isn't supplied it'll
get as far as cloning `hlagh', but won't add it.

So the first thing the user has to do is to remove `hlagh' and then
try again with the --force option.

That sucks, it should just add the path to begin with. I can't think
of any usecase where you've gone through the trouble of typing out
`git submodule add ..', but wish to be overriden by a `gitignore'. The
submodule semantics should be more like `git init', not `git add'.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-05 11:53:59 -07:00
..
2010-03-24 14:42:57 -07:00
2010-06-30 11:55:40 -07:00
2010-03-10 15:32:34 -08:00
2010-04-17 12:40:45 -07:00
2010-03-21 17:03:57 -07:00
2010-06-07 15:46:01 -07:00
2010-06-21 06:02:49 -07:00
2010-04-09 21:23:10 -07:00
2010-06-30 11:55:38 -07:00
2010-06-13 11:21:06 -07:00
2010-06-13 11:22:39 -07:00
2010-02-24 08:35:45 -08:00
2010-04-09 22:43:18 -07:00
2010-02-23 12:05:18 -08:00
2010-06-30 15:49:18 -07:00
2010-06-21 06:02:49 -07:00
2010-04-13 18:21:29 -07:00
2010-02-28 11:41:24 -08:00
2010-03-07 11:07:51 -08:00
2010-03-21 17:01:22 -07:00
2010-03-31 15:12:08 -07:00
2010-04-11 13:42:33 -07:00
2010-04-22 23:04:21 -07:00
2010-06-29 09:59:56 -07:00
2010-04-23 18:27:17 -07:00
2010-06-30 15:49:18 -07:00