2

I have two git repos, A and B under separate paths.

There is a sub-folder in one repo (A/subfolder) that contains some data files. On my local machine I have a symbolic link in B to access these files. This way I do not have to maintain two separate folders with identical contents. It works great.

The problem is that when I push these repos to github, the symbolic links in B do not work on other machines (as expected). What is the best way to handle this so that:

  • 1) I only have to maintain one physical directory on my local machine;

  • 2) Each git repo will contain the physical contents of subfolder so that users could clone either repo without issues;

  • 3) When I pull from the repo to my local machine, it does not create a duplicate copy of the files in subfolder

1

My solution was to use hard links instead of symbolic links. Hard links are not natively supported by OS X, but this tool implements them:

https://github.com/selkhateeb/hardlink

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.