1

I have a repository which now I want to use it as a library inside another repository, so first I cloned it in my project, then pushed my project to my repository, but as you see in the image, there is no way to open RF24 library from the repo.

enter image description here

How can I fix this?

Yashar
  • 2,455
  • 3
  • 25
  • 31

1 Answers1

2

If you just add a nested repo, its HEAD is recorded as a gitlink, but the parent repo does not know where to look for that repo.

You need to add RF24 as a submodule.

cd /path/to/parent/repo
git rm RF24
git add -A .
git commit -m "Removes nested repo"

Then the parent repo on GitHub would display RF24 as a gitlink (special entry in the index), this time referencing a SHA1 of the RF24 repo. Then:

git submodule add -- https://url/to/RF24
git add .
git commit -m "Add RF24 as a submodule"
git push
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250