2

I have copied an external folder containing some files to my repository

Added this new folder having content inside After that I run git status and it showed that in the modified files as expected

enter image description here

..I run the git add .

enter image description here

..it didn't show any errors. Then I run git status again to check if the files have been added to the staging area

enter image description here

Files weren't moved to the staging area. Why is it not moving this folder to the staging area? How may I move it to the staging area?

Kamran Ahmed
  • 11,809
  • 23
  • 69
  • 101

3 Answers3

1

jobtest is a submodule, not a regular folder.

You need to:

  • go within jobtest, add, commit, push,
  • then go back to the parent repo, add, commit and push (recording the new gitlink which represents the SHA1 of the jobtest repo).

As I explained in "Git diff says subproject is dirty", to get a clean status (ignoring the submodule state), you would need:

git status --ignore-submodules=dirty
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

I didn't remember that it jobtest was a repository on it's own when I copied that into this repository of my own. I didn't want it as a submodule so I removed .git folder from it to make it an ordinary folder, added and commited and that's it. It all worked.

Kamran Ahmed
  • 11,809
  • 23
  • 69
  • 101
  • +1. I knew jobtest was a repo, from the status message, as I mentioned in my answer. – VonC Oct 04 '14 at 15:39
0

Are You sure that directory jobtest contains files, because Git don't trac empty directories.

I You really need empty direcotry to be tracked, add at least one file jobtest/.gitignore with contents:

*
!.gitignore
Waldz
  • 104
  • 6