{"id":16962501,"url":"https://github.com/threeal/git-checkout-cmake","last_synced_at":"2026-03-06T10:05:48.859Z","repository":{"id":226583689,"uuid":"769097492","full_name":"threeal/git-checkout-cmake","owner":"threeal","description":"Clone and check out a Git repository from a CMake project ","archived":false,"fork":false,"pushed_at":"2026-02-03T06:32:09.000Z","size":132,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-03T19:34:52.942Z","etag":null,"topics":["cmake","cmake-modules","cmake-scripts","git","git-checkout","git-clone","github"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/threeal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-08T10:41:46.000Z","updated_at":"2026-02-03T06:32:11.000Z","dependencies_parsed_at":"2026-01-12T04:15:12.784Z","dependency_job_id":null,"html_url":"https://github.com/threeal/git-checkout-cmake","commit_stats":null,"previous_names":["threeal/git-checkout-cmake"],"tags_count":2,"template":false,"template_full_name":"threeal/cmake-starter","purl":"pkg:github/threeal/git-checkout-cmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgit-checkout-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgit-checkout-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgit-checkout-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgit-checkout-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threeal","download_url":"https://codeload.github.com/threeal/git-checkout-cmake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2Fgit-checkout-cmake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30171657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cmake-modules","cmake-scripts","git","git-checkout","git-clone","github"],"created_at":"2024-10-13T23:06:56.812Z","updated_at":"2026-03-06T10:05:48.832Z","avatar_url":"https://github.com/threeal.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitCheckout.cmake\n\nClone and check out a [Git](https://git-scm.com/) repository from a [CMake](https://cmake.org/) project.\n\nThis module contains a `git_checkout` function for cloning a Git repository from a remote location and checking out the files based on the given reference, which can be a commit hash, branch, or tag.\nIt also supports sparse checkout for checking out specific files from a large repository.\n\n## Key Features\n\n- Cloning a Git repository from a remote location.\n- Checking out a Git repository on a specific reference.\n- Support for sparse checkout.\n\n## Integration\n\nThis module can be integrated into a CMake project in the following ways:\n\n- Manually download the [`GitCheckout.cmake`](./cmake/GitCheckout.cmake) file and include it in the CMake project:\n  ```cmake\n  include(path/to/GitCheckout.cmake)\n  ```\n- Use [`file(DOWNLOAD)`](https://cmake.org/cmake/help/latest/command/file.html#download) to automatically download the `GitCheckout.cmake` file:\n  ```cmake\n  file(\n    DOWNLOAD https://threeal.github.io/git-checkout-cmake/v1.1.0\n    ${CMAKE_BINARY_DIR}/GitCheckout.cmake\n  )\n  include(${CMAKE_BINARY_DIR}/GitCheckout.cmake)\n  ```\n- Use [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to add this package to the CMake project:\n  ```cmake\n  cpmaddpackage(gh:threeal/git-checkout-cmake@1.1.0)\n  ```\n\n## Example Usages\n\nThis example demonstrates how to clone and check out a Git repository hosted on GitHub:\n\n```cmake\ngit_checkout(\"https://github.com/user/project\")\n```\n\n### Specify Output Directory\n\nUse the `DIRECTORY` option to specify the output directory for cloning the Git repository:\n\n```cmake\ngit_checkout(\n  \"https://github.com/user/project\"\n  DIRECTORY path/to/output\n)\n```\n\n### Specify Checkout Reference\n\nBy default, a Git repository will be checked out on the default branch. To check out on a specific commit hash, branch, or tag, use the `REF` option:\n\n```cmake\ngit_checkout(\n  \"https://github.com/user/project\"\n  REF latest\n)\n```\n\n### Use Sparse Checkout\n\nTo save bandwidth, it is recommended to use a sparse checkout to check out only specific files from the Git repository, especially on a large repository.\nTo do this, use the `SPARSE_CHECKOUT` option to list patterns of files to be checked out sparsely:\n\n```cmake\ngit_checkout(\n  \"https://github.com/user/project\"\n  SPARSE_CHECKOUT src test\n)\n```\n\n## License\n\nThis project is licensed under the terms of the [MIT License](./LICENSE).\n\nCopyright © 2024-2025 [Alfi Maulana](https://github.com/threeal)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeal%2Fgit-checkout-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreeal%2Fgit-checkout-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeal%2Fgit-checkout-cmake/lists"}