10

Perhaps I'm missing something here, but I've looked and I want to do something that looks pretty simple, but I've yet to figure out (or find someone who has) how to accomplish it.

  • I have a project, and I've found a Github repo that contains content I would like to use as part of it.
  • I want to fork that repo's content into my project (another repo)
  • I want the connection of the fork to remain in case of changes to the original file (otherwise I would've simply simply copy/pasted at the beginning -- also, I would like the option of issuing pull-requests).

I've tried to simply, git clone https://github.com/dave/repository_of_dave.git (and variations) but then there is still a connection with all of the content from Dave's repo. Is copy/pasting the only way to go here?

sos12
  • 699
  • 1
  • 6
  • 10
  • And...of course I found the answer as soon as I posted the question. In case anyone bumps into this question, the solution is found through something called 'submodules'. http://git-scm.com/book/en/Git-Tools-Submodules – sos12 Apr 11 '14 at 03:37

1 Answers1

6

Submodules are indeed a good fit, as your repo will only record a gitlink (special entry mode 160000) to record the commit of the submodule repo you are using.

Don't forget that this submodule is a git repo of its own, which means:

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250