threads / discuss / 29313

submodule add -f errs on un-ignored path

Subject: submodule add -f errs on un-ignored path

## tl;dr

2 messages between Jan 7, 2012 and Jan 9, 2012.

replies: 1people: 2as markdown or json

Neal Kreitzinger· Jan 7, 2012, 22:59 UTC · lore

git submodule add tells me to use -f because the path is ignored in gitconfig (even though I un-ignored it in .git/info/exclude), but with -f it give usage error. (git 1.7.1) Is this rejection by git intentional or unexpected? (This is my first foray into submodules.)

/etc/gitconfig is set to excludesfile that ignores: "WebPortal/Images/" entry

local .git/info/exclude is set to un-ignore it: cat .git/info/exclude !WebPortal/Images/ !WebPortal/Images !WebPortal\/Images\/ !WebPortal\/Images !WebPortal\/Images/

$ git submodule add file:///home/me/super/Images.git WebPortal/Images
Adding existing repo at 'WebPortal/Images' to the index
The following paths are ignored by one of your .gitignore files:
WebPortal/Images
Use -f if you really want to add them.
fatal: no files added
Failed to add submodule 'WebPortal/Images'
$ git submodule add -f file:///home/me/super/Images.git WebPortal/Images
Usage: git submodule [--quiet] add [-b branch] [--reference <repository>] 
[--] <
repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] 
[<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] update [--init] [-N|--no-fetch] [--rebase] 
[--ref
erence <repository>] [--merge] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit 
<n>]
[commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--] [<path>...]

v/r, neal

Thomas Rast· Jan 9, 2012, 15:40 UTC · re: Neal Kreitzinger · lore

Re: submodule add -f errs on un-ignored path

"Neal Kreitzinger" <neal@rsss.com> writes:
> $ git submodule add -f file:///home/me/super/Images.git WebPortal/Images
> Usage: git submodule [--quiet] add [-b branch] [--reference <repository>] [--] repository [<path>]

AFAICT this works since 1.7.2 (d27b876 to be precise). Before that the -f option didn't exist, and wasn't in the docs either.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

← back to recent threads