Skip to content

Checking out only a git folder

Olivier Michel edited this page Mar 16, 2022 · 1 revision

Github provides svn interface allowing to checkout only one folder on a specific branch or tag. Other options are possible. Given the URL to a Webots project is for example:

https://github.com/cyberbotics/webots/tree/master/projects/languages/python

We need to check out only this folder, not the whole webots repository. This can be achieve with svn on the master branch: svn checkout https://github.com/cyberbotics/webots/branches/master/projects/languages/python Or on the R2021 tag: svn checkout https://github.com/cyberbotics/webots/tags/R2021/projects/languages/python

To check if a branch or a tag exists: svn ls https://github.com/cyberbotics/webots/branches/master svn ls https://github.com/cyberbotics/webots/tags/R2021b git ls-remote --quiet --heads https://github.com/cyberbotics/webots.git master git ls-remote --quiet --tags https://github.com/cyberbotics/webots.git R2021b

git ls-remote --quiet https://github.com/cyberbotics/webots.git R2021b will tell whether R2021b is a branch or a tag.

Clone this wiki locally