2

In one of my projects monitored by git, I git cloned another repo from Github. Now I noticed that in the software Github for Mac, there are changes about Subproject commit. Somehow git is referring to the cloned directory as a file with 2 lines?

enter image description here

Trying to commit the changes will throw me the error

# On branch master
# 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:   packages/meteor-meteor (untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")
 (1)

Doing git add . still gives me the same error when doing a commit. What is happening here? I do not need to track/commit/push any changes on the cloned repo, just need to pull new updates when available.

Nyxynyx
  • 61,411
  • 155
  • 482
  • 830

1 Answers1

0

Somehow git is referring to the cloned directory as a file with 2 lines?

It is called a submodule.
you can see it declare in your .gitmodules file.

If you change anything within packages/meteor-meteor, the status of the parent repo (which contain that submodule) will reflect the "dirty" (modified) state of that submodule.

What you see is the SHA1 registered as a special entry in the index of the parent repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250