2

I am working on a project following Elixir's tutorial. I created a git repo named kv_umbrella. At some point, I dragged and dropped my kv folder inside kv_umbrella/apps. But somehow git is not tracking anything inside kv folder.

Github repo here.

If you go to the github repo and go inside apps, it is empty. However, in my local laptop, I have contents.

kv folder

When I git status, it shows that I have nothing to add:

kv_umbrella iggy$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

There is another SO post with issue similar to mine, but none of the top solutions worked.

I have tried git add . (after making changes in one of the files inside kv)

I also tried adding the file manually, but this is what shows up:

kv_umbrella iggy$ git add apps/kv/README.md
fatal: Pathspec 'apps/kv/README.md' is in submodule 'apps/kv'

What should I do to tell git to push kv folder content?

Iggy
  • 5,129
  • 12
  • 53
  • 87
  • if you don't want to use as git submodule, delete all .git* related files inside `kv` and try to `git add`, hope will work for you. – ntshetty Mar 29 '18 at 05:32

1 Answers1

5

It didn't track anything inside kv, because kv was recorded by its main parent repo as a gitlink.

That is, a special entry in the parent index, recording only the SHA1 of the tree represented by the kv sub-repo.

Instead of dragging it, you could reference it as a submodule.
Another approach would be subtree.

Or, if you don't care about the history of kv, simply remove its .git subfolder (then kv content will be added).

In the meantime, to remove the empty folder on GitHub:

git rm --cached apps/kv
# no trailing slash!

git commit -m "remove gitlink"
git push
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250