1
MainRepo
|
|--- repoABC

MainRepo is a git initiated repo.

MainRepo
|
| --- repoABC
|
| --- repoDEF (unclickable)

repoDEF is another git initialised repo moved inside MainRepo. After adding the repoDEF, I have git added and commited the mainRepo and then pushed to origin master .

See pic below: Only the first folder is accessible. How do I make the second folder accessible(clickable)

enter image description here

Deke
  • 4,451
  • 4
  • 44
  • 65
  • you may want to treat repoDEF as a submodule https://stackoverflow.com/questions/1811730/how-do-i-work-with-a-git-repository-within-another-repository – letthefireflieslive Jun 08 '18 at 03:17

1 Answers1

0

If you don't care about the history of the second repo, you can, locally in your repo, remove the gitlink (SHA1 reference in the index of your main repo), remove the repoDEF/.git/ subfolder, then add again and push:

cd MainRepo
git rm --cached repoDEF     # no trailing /
rm -Rf repoDEF/.git
git add repoDEF
git commit -m "Import repoDEF sources"
git push

But if you do care about repoDEF history, then you need to add that second repo as a submodule.

cd MainRepo
git rm -r repoDEF 
git submodule add repoDEF /url/repoDEF
git commit -m "Reference repoDEF as a submodule"
git push
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250