Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8312499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:11:09+00:00 2026-06-08T20:11:09+00:00

Why is git telling me that the path for my submodule is ignored? The

  • 0

Why is git telling me that the path for my submodule is ignored?

The following path is ignored by one of your .gitignore files:
multi/vim/.vim/bundle/powerline
Use -f if you really want to add it.

Here’s what I’m doing:

$ git subaddvim git://github.com/Lokaltog/vim-powerline.git powerline
The following path is ignored by one of your .gitignore files:
multi/vim/.vim/bundle/powerline
Use -f if you really want to add it.
$ git help subaddvim
`git subaddvim' is aliased to `!f(){ [ $# -eq 2 ] && git submodule add $1 multi/vim/.vim/bundle/$2; };f'

Edit: Looks like it’s the p in powerline:

$ git subaddvim git://github.com/Lokaltog/vim-powerline.git p
The following path is ignored by one of your .gitignore files:
multi/vim/.vim/bundle/p
Use -f if you really want to add it.
$ git subaddvim git://github.com/Lokaltog/vim-powerline.git owerline
Cloning into 'multi/vim/.vim/bundle/owerline'...

I don’t understand why.

Edit 2: I found a file in the submodule clone destination:

multi/vim/.vim/bundle$ cat powerline/.git
gitdir: ../.git/modules/multi/vim/.vim/bundle/powerline

If I remove that and try again, I get a different error:

$ git subaddvim git://github.com/Lokaltog/vim-powerline.git powerline
fatal: Not a git repository: ../.git/modules/multi/vim/.vim/bundle/powerline
Unable to checkout submodule 'multi/vim/.vim/bundle/powerline'

Maybe there’s some thing messed up with my .git? (I had cloned this repo yesterday and then reverted that change.)

Edit 3: I tried using git submodule directly (instead of my alias) and it worked! I can re-create the issue (sometimes) by doing git reset --hard after the clone. Seems like it’s a combination of my alias not working the same as the git command git ignoring the .git file (or doing something magic that I don’t understand). And maybe something to do with my .git/config having a reference to powerline.

Edit 4: My previous edit wasn’t clear: Although using git submodule directly worked. It does not always work. I don’t know why it worked in the first place.

I’ve narrowed it down to a reproducible case. It looks like the issue is caused by git assuming that submodules are in the root directory. Here’s my test script.

if [ ! -d remote ] ; then
    echo
    echo Setup remote test repo 
    mkdir remote
    cd remote
    git init
    touch firstfile
    git add firstfile
    git ci -m'first'
    cd -
fi

# Pick one of these lines:
submodule=multi/plugin
# OR
submodule=plugin

echo
echo Setup test repo 
mkdir test
cd test
git init
touch firstfile
git add firstfile
git ci -m'first'

echo
echo submodule add
git submodule add ../remote $submodule
ls -ld $submodule/.git
cat $submodule/.git

echo
echo submodule remove
git reset --hard HEAD
ls -ld $submodule/.git
cat $submodule/.git
rm -r $submodule/

echo
echo submodule re-add
git submodule add ../remote $submodule
ls -ld $submodule/.git
cat $submodule/.git

Using submodule=multi/plugin will fail:

submodule re-add
fatal: Not a git repository: ../.git/modules/multi/plugin
Unable to checkout submodule 'multi/plugin'
-rw-r--r-- 1 pydave mkgroup 37 Aug  1 10:08 multi/plugin/.git
gitdir: ../.git/modules/multi/plugin

(After this, if you run git submodule add, you’ll get the “following path is ignored” message.)

But submodule=plugin will succeed:

submodule re-add
-rw-r--r-- 1 pydave mkgroup 31 Aug  1 10:07 plugin/.git
gitdir: ../.git/modules/plugin

The relative paths are both using ../.git, which is only correct for the second option — when the submodule is in the root of the git project.

I’ve rename this question to be more specific to my problem and re-asked the original question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:11:10+00:00Added an answer on June 8, 2026 at 8:11 pm

    I think the answer is that there’s a bug in git when using submodules that are not in the top-level directory.

    The solution is to delete the git repo for the submodule stored in .git/modules:

    $ rm -fr multi/plugin/ .git/modules/multi/plugin/
    $ git submodule add ../remote multi/plugin
    Cloning into 'multi/plugin'...
    done.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

git status tells me that my branch and the one I started from on
Git says to use git add to add untracked files to my repo. I
I'm working with a git repository that's storing data for a website. It contains
git remote add joyent yourname.no.de:repo I'm assuming that this means it is using the
I am trying to add a git submodule to my project, but git keep
git is a very powerful tool, but not that easy to use For example,
git log lists all commits, from all branches that have been merged into HEAD.
I'm having difficulty getting Git to cooperate with my user-defined worktree that exists outside
I am using Windows. When staging files I get this error. Updating the Git
Git is excellent tool: you could switch to the one of previous versions and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.