If there is a need to download only a sub-directory of the full Github repo, you can do the following steps to clone the required directory.
- git clone <repo root url> <name of the sub-directory>
- cd <name of sub-directory>
- git filter-branch --prune-empty --subdirectory-filter <path to sub-directory> HEAD
Ex: Let's say you need to clone the apim-is-as-keymanager-sso directory from https://github.com/wso2/presales-demos GitHub repo. Execute the following commands.
- git clone https://github.com/wso2/presales-demos apim-is-as-keymanager-sso
- cd apim-is-as-keymanager-sso
- git filter-branch --prune-empty --subdirectory-filter apim-is-as-keymanager-sso HEAD
Happy Coding!
No comments:
Post a Comment