1

I am curious if there is anyway to ignore the hidden /.git directory as well as other git related files (ie: .gitignore) so that I can have a parent git repository that can track the raw local contents of the parent git repository with children git repositories within it.

for example I have a tree as follow:

C:.
│   .gitignore
│   README.md
│
└───child-repo
        .gitignore
        README.md

I do not want the child-repo to be a submodule because it will live in a private Azure DevOps instance and submodules are not handled well this way.

I have tried updating the parent .gitignore to be:

.*
!.gitignore
**/.git

As well as adding .* to .git/info/exclue

and still child-repo is treated as a submodule..

ejj
  • 172
  • 2
  • 3
  • 18
  • Are you looking to add the contents of the child repo as part of your main repo, or are you wanting to keep it separate? Also, are you actually storing a repository in the root of your `C:` drive? If so, that's a bad idea. – bk2204 Jul 22 '20 at 01:06
  • >Are you looking to add the contents of the child repo as part of your main repo, or are you wanting to keep it separate? yes as part of the main repo – ejj Jul 22 '20 at 01:35
  • @casper Not get your latest information, is VonC's answer helpful for you? Or if you have any concern, feel free to share it here. – Hugh Lin Jul 24 '20 at 09:11

1 Answers1

0

child-repo should not be treated as a gitlink (not as a submodule, since there is no .gitmodules file) if:

  • you ignore it
  • make sure it is not already tracked

That is:

cd /main/repo
git rm --cached child-repo # no trailing slash
echo "child-repo/">>.gitignore
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250