Lars Ericson
Lars Ericson

Reputation: 2094

How do I clone someone else's GitHub repo as a subdirectory of my repo?

I would like to add functions from another repo into my repo. To preserve the edit history and licensing info from that repo in the cleanest way, while still building on and modifying that repo to fit into mine, I want to clone it as a subdirectory in my repo.

This has been asked here but I don't see a clean answer in that link. Is there a clean and simple way to do this?

Upvotes: 0

Views: 123

Answers (1)

Rupesh
Rupesh

Reputation: 538

You can use the feature called GitHub submodules which you find a detail description here

TL;DR

git submodule add <git@github ...> folder/to/submodule/

Upvotes: 1

Related Questions