3

I have been trying to push an entire folder to my repo on Bitbucket and I kept getting following when I view the source:enter image description here

I also check the commit to find it empty, Nothing was pushed. The folder was initially named ChartNew.js as result of a clone, so I tried renaming it mutiple times but I am still stuck with this issue.

Any idea how can I fix that.


UPDATE:

so I tried the second answer in No submodule mapping found in .gitmodules for path and missing .gitmodules file and yes the folders were removed successfully. I cloned the Charts repo to redo the push my repo but then I got stuck again with the same problem and the same issue in the screenshot above occured. :/

Community
  • 1
  • 1
omarsafwany
  • 3,695
  • 8
  • 44
  • 75
  • 1
    Git doesn't track directories. Does it contain any files? – Biffen May 24 '15 at 15:26
  • yes the folder contains mutiple files but nothing was pushed to the repo – omarsafwany May 24 '15 at 15:28
  • Those are not submodule entries? What happen if you clone that BitBucket repo? Do you see those folders empty? Do they fill up after a `git submodule update --init`? – VonC May 25 '15 at 09:39
  • @VonC I tried to clone the repo again but the folder ChartNewjs is empty. When pushed the first time, nothing inside it was pushed to the repo so basically nothing was there when I cloned again – omarsafwany May 25 '15 at 10:04
  • @omarsafwany do you see a .gitmodule in your repo? – VonC May 25 '15 at 10:08
  • @VonC no it's not there – omarsafwany May 25 '15 at 10:10
  • Strange, because you have the same picture in http://stackoverflow.com/a/30075692/6309 – VonC May 25 '15 at 10:17
  • I ran the following command git submodule update --init --recursive but I got this response: No submodule mapping found in .gitmodules for path 'public/ChartNewjs' – omarsafwany May 25 '15 at 10:20
  • 1
    Ok, can you try `git rm ChartNewjs` (no trailing /) and `git rm Charts`? Maybe the .gitmodule was deleted, and the gitlinks remains in the index. Then `add -A .` and commit and push. – VonC May 25 '15 at 10:39
  • @VonC Finally!!! git add -A . worked and the issue was fixed. Thank you – omarsafwany May 25 '15 at 11:20
  • 1
    Great. I have edited my answer accordingly. – VonC May 25 '15 at 11:25

1 Answers1

2

Those are submodule entries.

They are called gitlink, special entries in the index of the pushed repo.

A submodule is made to record a specific SHA1 of a subrepo: see "git submodule checks out the same commit".

If a .gitmodule is no longer in the repo, then those gitlinks need to be removed:

git rm ChartNewjs # no trailing /
git rm Charts
git add -A . 
git commit -m "remove gitlinks submodules"
git push

omarsafwany suggests in the edit revision:

In case git rm didn't remove anything, then check the the answer "No submodule mapping found in .gitmodule for a path that's not a submodule", in order to remove, then proceed with the above instructions.

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