{"id":13872224,"url":"https://github.com/SwiftDocOrg/Git","last_synced_at":"2025-07-16T02:30:28.312Z","repository":{"id":47798307,"uuid":"281213830","full_name":"SwiftDocOrg/Git","owner":"SwiftDocOrg","description":"A Swift package for working with Git, built on top of libgit2.","archived":true,"fork":false,"pushed_at":"2021-07-14T21:36:40.000Z","size":147,"stargazers_count":48,"open_issues_count":2,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-17T17:35:45.447Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwiftDocOrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-20T20:01:03.000Z","updated_at":"2024-08-02T07:46:57.000Z","dependencies_parsed_at":"2022-09-03T10:22:05.762Z","dependency_job_id":null,"html_url":"https://github.com/SwiftDocOrg/Git","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftDocOrg%2FGit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftDocOrg%2FGit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftDocOrg%2FGit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftDocOrg%2FGit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwiftDocOrg","download_url":"https://codeload.github.com/SwiftDocOrg/Git/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226095608,"owners_count":17572959,"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","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-08-05T23:00:37.334Z","updated_at":"2024-11-23T20:30:44.297Z","avatar_url":"https://github.com/SwiftDocOrg.png","language":"Swift","readme":"# Git\n\nA package for working with Git repositories in Swift,\nbuilt on top of [libgit2](https://libgit2.org).\n\n\u003e **Warning**:\n\u003e This is currently a work-in-progress and shouldn't be used in production.\n\n## Requirements\n\n- Swift 5.2\n\n## Usage\n\n```swift\nimport Git\nimport Foundation\n\nlet remoteURL = URL(string: \"https://github.com/SwiftDocOrg/StringLocationConverter.git\")!\nlet localURL = URL(fileURLWithPath: \"\u003c#path/to/repository#\u003e\")\nlet repository = try Repository.clone(from: remoteURL, to: localURL)\n\nrepository.head?.name // \"refs/heads/master\"\n\nlet master = try repository.branch(named: \"refs/heads/master\")\nmaster?.shortName// \"master\"\nmaster?.commit?.message // \"Initial commit\"\nmaster?.commit?.id.description // \"6cf6579c191e20a5a77a7e3176d37a8d654c9fc4\"\nmaster?.commit?.author.name // \"Mattt\"\n\nlet tree = master?.commit?.tree\ntree.count // 6\n\ntree?[\"README.md\"]?.object is Blob // true\nlet blob = tree?[\"README.md\"]?.object as? Blob\nString(data: blob!.data, encoding: .utf8) // \"# StringLocationConverter (...)\"\n\ntree?[\"Sources\"]?.object is Tree // true\nlet subtree = tree?[\"Sources\"]?.object as? Tree\nsubtree?.count // 1\nsubtree?[\"StringLocationConverter\"]?.object is Tree // true\n\n\nlet index = repository.index\nlet entries = index?.entries.compactMap { $0.blob }\nentries?.count // 9\n```\n\n## License\n\nMIT\n\n## Contact\n\nMattt ([@mattt](https://twitter.com/mattt))\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwiftDocOrg%2FGit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSwiftDocOrg%2FGit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwiftDocOrg%2FGit/lists"}