I think this issue has already been discussed under this question :
Recursively add the entire folder to a repository
However I still can not add some folders to a git repository and I need help.
$ git status
...
# modified: folder_to_add1 (modified content, untracked content)
# modified: folder_to_add2 (modified content, untracked content)
These folders originally belonged to another git repository, so I entered the folders and deleted the .git folder inside.
I then ran:
$ git add folder_to_add1
$ git add folder_to_add2
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <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)
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ../filestore/
# ../../stdout
no changes added to commit (use "git add" and/or "git commit -a")
Neither folder_to_add1 and folder_to_add2 can be committed.
There is no .gitignore file in my repo.
What else can I try ? Thanks.
I will try to add further information regarding my original post which ended right before previous line. I will appreciate your comments regarding "this" being considered the right war to further clarify my original question, I am a complete newbie posting here.
Dear torek, thanks for your very detailed answer. I guess I will have to read it very carefully to understand the subtleties involved with the submodules concept. I guess submodules are very much like "svn externals" which I am more familiar with.
From a ten minutes reading of your answer, my answer is: "I do not want a submodule or subgit at all". I mean: I want these folders, originally being submodules, to be part of only one project instead of many projects (to use a figure).
I am sure your answer is somewhere telling me why this is happening, but the fact is that I need to copy my project from one PC to another one and by using git to do it, these folders are actually not included in the index with "git add " regardless of whether there is a .git subfolder in them or not.
A ".gitmodules" file does not seem to exist. After running :
$ find . -name .gitmodules -print
on the main folder of the project I get no results.
What I did to be able to add these folders to a new (different) repository was:
$ cp -r myproject /home/myusername/newproject
$ cd /home/myusername/newproject/folder_to_add1
$ rm -r .git
$ cd ../folder_to_add2
$ rm -r .git
$ cd /home/myusername/newproject
$ git init
$ git add .
$ git commit -m "Adding all existing files to the new repository"
But I think I loose all file changes history by doing it this way.