Search code examples
gitsystemhiddensubdirectory

Are there any technical issues with creating custom folders inside .git directory of repository?


A project I'm working on requires a specific hidden folder inside any cloned git repository; however, this obviates the need to create a .gitignore file, so 2 extra hidden items inside these repositories will be needed, and the end user (developer) should have access to the .gitignore, which may cause issues.

An alternative idea is to place this "hidden" system folder inside the .git folder, then no need for extra .gitignore -or extra hidden folder inside the root of that (local) repo.

This folder and it's contents should remain local and not be pushed upstream in any way, and should not interfere with git in any way whatsoever.

Will this cause any "unforeseen" issues?


Solution

  • git worktree allows you to have more than one working tree for one clone. This is a quite convenient thing I won't like to miss..

    In this case the additional worktrees don't have a .git directory but a .git file. As long as your tools can cope with this it should be OK but it is still a strange use case.