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 6724253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:40:01+00:00 2026-05-26T09:40:01+00:00

I’ve added a submodule to my project in project_dir/vendor/submodule_one now each time I run

  • 0

I’ve added a submodule to my project in project_dir/vendor/submodule_one now each time I run git status I get modified: vendor/submodule_one (new commits).

My question is whats the best way to deal with this? Do I add the vendor/submodule_one-folder to my .gitignore as my main project shouldn’t need to know about the specifics of my submodule?

Or when I’m changing and commiting changes to my submodule do I need to make commits in my main project also?

Just getting started with submodules and couldn’t seem to find much info beyond setting them up.

  • 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-05-26T09:40:01+00:00Added an answer on May 26, 2026 at 9:40 am

    No, you don’t need to add your submodule to your .gitignore: what the parent will see from your submodule is a gitlink (a special entry, mode 160000).

    That means: any change directly made in a submodule needs to be followed by a commit in the parent directory.
    That way, the parent directory will record the right commit for the state of the submodule: That commit is the “gitlink” mentioned above;

    You can read more about that policy in “git submodule update (true nature of submodules)“.
    The main idea behind submodules is a component-based approach, where you reference other repos at specific commits. But if you change anything in those submodules, you need to update those references in the parent repo as well.


    Note that with Git 2.13 (Q2 2017), while not ignoring the gitlink, you can still ignore the submodule with:

    git config submodule.<name>.active false
    

    See more at “Ignore new commits for git submodule“.


    Note: with Git 2.15.x/2.16 (Q1 2018), ignoring a submodule is more precise.
    “git status --ignored --untracked” did not stop at a working tree of a separate project that is embedded in an ignored directory and listed files in that other project, instead of just showing the directory itself as ignored.

    See commit fadb482 (25 Oct 2017) by Johannes Schindelin (dscho).
    (Merged by Junio C Hamano — gitster — in commit da7996a, 06 Nov 2017)

    status: do not get confused by submodules in excluded directories

    We meticulously pass the exclude flag to the treat_directory() function so that we can indicate that files in it are excluded rather than untracked when recursing.

    But we did not yet treat submodules the same way.

    Because of that, git status --ignored --untracked with a submodule
    submodule in a gitignored tracked/ would show the submodule in the
    “Untracked files” section, e.g.

    On branch master
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
    
        tracked/submodule/
    
    Ignored files:
      (use "git add -f <file>..." to include in what will be committed)
    
        tracked/submodule/initial.t
    

    Instead, we would want it to show the submodule in the “Ignored files”
    section:

    On branch master
    Ignored files:
      (use "git add -f <file>..." to include in what will be committed)
    
        tracked/submodule/
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.