Skip to main content
3 of 3
typo thanks for the suggestion - been editing at the same time, thats why community rejected your edit
nath
  • 6.1k
  • 13
  • 51
  • 94

Git - how to add/link subfolders into one git-repository directory

Assuming I have a file structure like this:

├── Project-1/
│   ├── files/
│   └── special-files/
├── Project-2/
│   ├── files/
│   └── special-files/
└── Project-3/
    ├── files/
    └── special-files/

Now I want to create a Git repository, including all the special-files folders. If it was files, I could create a hardlink ln ./Project-1/special-files ./Git-Project/special-files-1 and so on, so I would get:

Git-Project/
├── .git
├── .gitignore
├── special-files-1/
├── special-files-2/
└── special-files-3/

Though hardlinks do not work with folders. Symlinks do not get handled by git. Is there a way to achieve, collecting/linking these folders into a git repository-folder?

nath
  • 6.1k
  • 13
  • 51
  • 94