简体   繁体   中英

Unable to add submodules in Git

I am unable to push the following sub-module into Github through Git. I'm seeing the following error message. What am I doing wrong?

I followed this steps:

cd my_project
git init
git add *
git status

Then it shows the messages as :

   Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)
      (commit or discard the untracked or modified content in submodules)

        modified:   server/auth (modified content)

    no changes added to commit (use "git add" and/or "git commit -a")

After when i am pushing, my subfolder server/auth is not going to my github repository, Please help me with this i am new to this : My project structure is as follows: Server as main and clients , resource and auth as submodules, except for " auth " everything is commiting.

what's your definition of Git Submodule ? When I look at your 4 steps it seems to me, that you create a new Git repository with few subfolders but no git submodule?

I you'd want to add git submodules for clients , resource and auth you probably would do something like this:

cd my_project
git init
git submodule add <global-path-to-sub-repository> **clients**
git submodule add <global-path-to-sub-repository> **resource**
git submodule add <global-path-to-sub-repository> **auth**
git submodule init
git add *
git status

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM