I have project I want to store in a 开发者_JAVA技巧git repository and put into github where the substructure of the tree currently has a symbolic link shared folder for common code (contained within the tree - not outside of the tree) between top level folders and the tree.
Example:
. - top level project for repo where .git lives
folderA
sharedFolder - real folder
folderB
sharedFolder -> ../folderA/sharedFolder - symbolic link folder to avoid duplicate files
Can this be done and how?
I would consider making the content of the sharedFolder its own git repo if that makes for a solution where I can still avoid duplicating code between the content needed in folderA and folderB - if I do that, how would setup the two git repos for this scenario?
If you put sharedFolder
in its own git repository, you can do git submodule add sharedFolder
in each repository that uses it.
For more information, you should look up the git submodule
command.
Github has more information about submodules here.
精彩评论