11

I'm working on a little library and it depends on another github project.

I know that some projects add symlinks. How exactly do you do that?

Zombo
  • 1
  • 62
  • 391
  • 407
James P. Wright
  • 8,991
  • 23
  • 79
  • 142
  • 1
    [http://stackoverflow.com/questions/954560/what-does-git-do-to-files-that-are-a-symbolic-link](http://stackoverflow.com/questions/954560/what-does-git-do-to-files-that-are-a-symbolic-link) – Keith Thompson Sep 07 '11 at 03:21
  • Thanks for the link but that doesn't really explain how to DO it, just what happens if you have it. For example, Do I just check out the dependency project to a subdirectory of my project and boom it works? – James P. Wright Sep 07 '11 at 03:24
  • Sorry, I read too quickly and missed the part about depending on another github project. I don't have an answer. – Keith Thompson Sep 07 '11 at 03:27
  • 1
    Your example link is broken. Perhaps you can link to a specific commit of that project? I was not able to find anything relevant quickly using GitHub's advanced search function. Maybe there's a trick. – Neil Best Mar 22 '13 at 22:17

1 Answers1

16

What you'll want to use are git submodules.

Example: git submodule add git://github.com/user/project.git destination-dir/

Jorge Israel Peña
  • 36,800
  • 16
  • 93
  • 123
  • 1
    This is a good guide that covers basic submodule usage: http://codingsnippets.com/getting-started-with-git/ – 0x6A75616E Sep 07 '11 at 03:39
  • Note however, that this works if the other code has is own git repo. Otherwise, a symlink solution works great, like this [Shared models between two Rails apps - what is the ideal solution for Workflow?](http://stackoverflow.com/questions/7024741/shared-models-between-two-rails-apps-what-is-the-ideal-solution-for-workflow) – David Pelaez Feb 28 '13 at 19:24