Can you have multiple independent directories in a git repository?

Hi everyone,

Sorry if this question has been asked before, but hours of googling could still not clear this up for me.

What i mean is, if you have two independent directories, say c:/a/b/c/dir_one and d:/x/y/z/dir_two (neither being a child or a parent of the other), is it possible to have the two in the same repository?

Sort of like if the repository contained two symlinks to the dirs, but without using symlinks (which would't work in this case)?

Or do they need to be in separate repositories?


If anybody knows the answer, please share it with me (and the rest of the world) :)

Thank you very much!


1 answer

0 votes


As far as I know, you can't do that git assumes a single parent directory.


I'm really glad to get a definite (even negative) answer on this issue.

Now I can put it aside and find another solution.


Thank you!


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

964 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you