1

In my git repository (Bitbucket) I have a reference to a sub project.

When I pushed it on the first place a .git/ folder was included (even though I use the repository only for backup so that'd not been really needed).

Now I have a reference to that submodule in the repository

 <folder_name> → <SHA> [<SHA>])
  • When I do git pull origin master the folder if fetched but it's empty.
  • When I try to put stuff in that folder (I removed it, then I pulled it from a different repository and then removed the .git/ folder to make it looks a normal folder, not a submodule) and then git add . && git commit -m ".." && git push origin master I only get Everything's up-to-date and of course nothing changed in the remote repository

Goal: push a past submodule as a normal folder part of the main repository.

What I missing out? How do submodules work? (the docs @ Github are not very clear to me)

dragonmnl
  • 14,578
  • 33
  • 84
  • 129

1 Answers1

3

As I explained this morning in "How to solve this Git issue?", this (ie '<folder_name> → <SHA> [<SHA>]') is not a submodule.

A submodule is composed of:

If you record only the SHA1, but not the url, you will have something like:

https://i.stack.imgur.com/d8JYH.png

A git clone --recursive won't be able to clone the repo with that SHA1, because it does not know its url.

If you want to reference a subproject as a submodule:

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • so basically that's just a folder I can't do anything anymore with? – dragonmnl Jun 03 '16 at 12:30
  • also, what'd explain git diff is not showing any change despite I cloned another repository into my repository and made sure to remove the. git/ folder (so basically it should be seen as a normal folder)? – dragonmnl Jun 03 '16 at 12:31
  • Yes, I explained in my previous answer how to get rid of it and replace it by an actual subfolders. – VonC Jun 03 '16 at 12:50