Git-tracked Folder Within a Git-tracked Folder

后端 未结 1 442
孤城傲影
孤城傲影 2021-01-07 08:01

I developed a web project and tracked it with git. Later I had to use that project in another big project which is again tracked by git. Earlier I didn\'t have knowledge abo

1条回答
  •  时光说笑
    2021-01-07 09:04

    If I change any thing in the small project within the big project, it is not getting tracked.

    It is not being tracked because it was seen by the parent project as a gitlink for nested repo. That is, just a SHA1, not its actual content.

    If your first repo was pushed somewhere remote, then you could add it as submodule of your main repo with git submodule add.

    cd second/big/repo
    git submodule add -- /url/first/repo
    

    If not, you would need to recreate your first repo (outside the big repo), push it somewhere remote (GitHub, GitLab, Bitbucket, ...) and add it as submodule of your big repo.

    0 讨论(0)
提交回复
热议问题