1

I have git repo in folder final_app and I have to add new folder app_part which is already git project. When I copied and try git add . or git add --all but it doesn't want to add app_part. How to add files from app_part folder to git repo final_app ?

PaolaJ.
  • 10,872
  • 22
  • 73
  • 111

1 Answers1

3

You need to not copy it and add that git repo as a submodule:

cd final_app
git submodule add /url/of/repo/app_part/
git add .
git commit -m "Add app_part as submodule"

If you copy it directly, it is just a nested repo which will be ignored by the parent repo.

Adding it as a submodule means adding a gitlink, a special entry in your final_app index, referencing a SHA1 of the app_part repo.

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