Glam Prestige Journal

Bright entertainment trends with youth appeal.

I'm trying to add a reference from one Git repository to a specific folder from a remote repository.

Example:

repo-1

.
├── a
├── b
└── c

repo-2

.
├── A
├── B # this should link to repo-1's `b` folder
└── C

Edit 1: To clarify, I'm using Git

1 Answer

This is not possible with git.

Each commit reference is a pointer to a snapshot of the entire tracked file system and so any linking would be to the entire repository and not a portion of it.

The work around would be to make 'folder' b it's own seperate repository. You would then include this in repo-1 and repo-2 as a submodule.

explains submodules in detail.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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