{"id":15629529,"url":"https://github.com/sharplet/swift-git","last_synced_at":"2025-10-09T11:36:26.014Z","repository":{"id":47466821,"uuid":"381055288","full_name":"sharplet/swift-git","owner":"sharplet","description":"Swift bindings for libgit2.","archived":false,"fork":false,"pushed_at":"2023-06-23T16:25:55.000Z","size":61,"stargazers_count":21,"open_issues_count":5,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-29T23:33:26.854Z","etag":null,"topics":["git","libgit2","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sharplet.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}},"created_at":"2021-06-28T14:13:22.000Z","updated_at":"2025-02-14T21:01:09.000Z","dependencies_parsed_at":"2024-10-23T01:01:54.731Z","dependency_job_id":null,"html_url":"https://github.com/sharplet/swift-git","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sharplet/swift-git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharplet%2Fswift-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharplet%2Fswift-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharplet%2Fswift-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharplet%2Fswift-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharplet","download_url":"https://codeload.github.com/sharplet/swift-git/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharplet%2Fswift-git/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001304,"owners_count":26083058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["git","libgit2","swift"],"created_at":"2024-10-03T10:27:30.593Z","updated_at":"2025-10-09T11:36:25.983Z","avatar_url":"https://github.com/sharplet.png","language":"Swift","readme":"# swift-git\n\nSwift bindings for [libgit2][].\n\n```swift\nimport ArgumentParser\nimport Git\n\nstruct GitExample: ParsableCommand {\n  @Argument var url: URL\n  @Argument var path: FilePath\n\n  func run() throws {\n    let repo = try Repository.clone(from: url, to: path)\n    print(\"Cloned to path '\\(repo.path)'.\")\n\n    let fileCount = repo.index.entries.count\n    print(\"Repsitory contains \\(fileCount) files.\")\n\n    let head = try repo.head()\n    print(\"HEAD points to commit \\(head.commitID).\")\n\n    let branch = try repo.makeBranch(\"new-branch\", switch: true)\n    assert(head.commitID == branch.commitID)\n  }\n}\n```\n\nFor more examples, see [the swift-git-example project][swift-git-example].\n\n## Installation\n\nswift-git is distributed as a Swift Package. Add it to your Package.swift file\nlike so:\n\n```swift\nlet package = Package(\n  // ...\n  dependencies: [\n    .package(url: \"https://github.com/sharplet/swift-git\", from: \"0.1.0\"),\n  ],\n  targets: [\n    .target(\n      name: \"MyTarget\",\n      dependencies: [\n        .product(name: \"Git\", package: \"swift-git\"),\n      ]\n    ),\n  ]\n)\n```\n\nIn Xcode, select File \u003e Swift Packages \u003e Add Package Dependency… and follow the\nprompts.\n\n## License\n\nswift-git is published under the MIT License.\nSee [LICENSE](/LICENSE) for details.\n\nswift-git is subject to the terms of the [swift-cgit2 license][] and the\n[libgit2 license][]. This means that you may compile and link to these projects\nwithout restriction; however, uses of libgit2 which fall outside the linking\nexception are subject to the full terms of the GNU General Public License,\nVersion 2.\n\n## Alternatives\n\n- For more complete Apple platform support and `Result`-based error handling,\n  take a look at [SwiftGit2][].\n\n[SwiftGit2]: https://github.com/SwiftGit2/SwiftGit2\n[libgit2 license]: https://github.com/libgit2/libgit2/blob/main/COPYING\n[libgit2]: https://libgit2.org/\n[swift-cgit2 license]: https://github.com/sharplet/swift-cgit2/blob/main/LICENSE\n[swift-git-example]: https://github.com/sharplet/swift-git-example\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharplet%2Fswift-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharplet%2Fswift-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharplet%2Fswift-git/lists"}