Solved GitLab Symlink folder to another project?
-
I have a project in GitLab, let's call it
/project1.git
.
I have another project in GitLab, let's call that one/project2.git
.In
/project2.git
, is it possible to symlink a folderproject2/folder
to/project1
? -
@stacksofplates said in GitLab Symlink folder to another project?:
Use submodules for this.
git submodule add https://gitlab.com/<user>/repo repo
Thanks, this is exactly what I was looking for!
Looked up submodules, and found two good references, posting them here for future reference.
-
That feels like a really bad idea.
-
What I want to avoid doing is copying and pasting code from project1 into a folder in project2 every time it changes.
-
Take a look this.
https://gist.github.com/whistler/de34b77aba2221ed8b2e -
Use submodules for this.
git submodule add https://gitlab.com/<user>/repo repo
-
@stacksofplates said in GitLab Symlink folder to another project?:
Use submodules for this.
git submodule add https://gitlab.com/<user>/repo repo
Yes submodule is the right way. Isolate common code into a library. Make a git for the lib. Submodule it in both of your projects.
-
@Tim_G now that you have submoduled a folder guess: how to remove that folder from project1. Or better how to move the entire history of 'folder' into a new git?! Welcome to hell buahahah... (Done this one time. Still recovering from it :p)
-
@stacksofplates said in GitLab Symlink folder to another project?:
Use submodules for this.
git submodule add https://gitlab.com/<user>/repo repo
Thanks, this is exactly what I was looking for!
Looked up submodules, and found two good references, posting them here for future reference.