Reputation: 5153
I have a long-standing personal repository for "Resume/", holding my resume contents. I have also had a subdir "Resume/Cover Letter", holding my CV contents that had worked well. I had created a second git repository inside "Resume/Cover Letter" awhile back, did not think much of it. Now these contents are gone! How can this be though, there is no .gitmodules in my 'Resume' project.
I can see all record of the Cover Letter repo in the log for Resume/ -
History Example:
But the contents of "Resume/Cover Letter" is empty. Where did these files go? Can they be retrieved? Here is a useful illustration -
Example
Update
Doh! See the reference below, for clear warning not to do this -
Upvotes: 2
Views: 494
Reputation: 1324827
When you have a nested Git repository, your parent repo only records a gitlink (a special entry in the index)
So git add/git commit/git push
done in the main repository does not add/commit/push files in the nested Git repository at all.
The same command done in the nested repo folder itself would have added/committed/pushed your files.
Upvotes: 3