{"id":17078518,"url":"https://github.com/dazinator/fluentgit","last_synced_at":"2026-02-19T13:01:15.150Z","repository":{"id":30781917,"uuid":"34338775","full_name":"dazinator/FluentGit","owner":"dazinator","description":"A fluent API for managing Git repositories in .NET.","archived":false,"fork":false,"pushed_at":"2015-04-25T14:28:58.000Z","size":216,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-06T19:14:17.449Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dazinator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-21T16:27:38.000Z","updated_at":"2015-04-25T14:28:58.000Z","dependencies_parsed_at":"2022-09-03T21:24:40.204Z","dependency_job_id":null,"html_url":"https://github.com/dazinator/FluentGit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dazinator/FluentGit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazinator%2FFluentGit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazinator%2FFluentGit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazinator%2FFluentGit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazinator%2FFluentGit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dazinator","download_url":"https://codeload.github.com/dazinator/FluentGit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dazinator%2FFluentGit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29614586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"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":[],"created_at":"2024-10-14T12:22:27.682Z","updated_at":"2026-02-19T13:01:15.114Z","avatar_url":"https://github.com/dazinator.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FluentGit\nA fluent API for performing Git operations in .NET.\n\n## Why?\n\nWell, [libgit2sharp](https://github.com/libgit2/libgit2sharp) provides a great object model for working with git repositories.\n\nThe goal of FluentGit is to provide a Fluent API that makes it quicker and easier to accomplish things, than using the `libgit2sharp` object model directly.\n\nFor example, rather than having to write 50 lines of code with `libgit2sharp` to instantiate a repo, add a remote, checkout a branch and checkout files, you could achieve the same things using `FluentGit` in say, only 10 lines - and also benefit from being guided through each operation by the fluent API (intellisense) every step of the way.\n\n##Examples\n\n### Complex example - aim's to demonstrate a decent surface of the API.\n\n``` csharp\n var repo = new FluentRepo().Clone()\n                .FromUrl(\"http://someurl.git\")\n                .ToDirectory(\"c:/myclone/\")\n                .WithCredentials(\"johnycash\", \"password\")\n                .Bare()\n                .Obtain() // Performs the clone operation and returns an instance of the fluent repo builder.\n                      .AddRemote(a =\u003e\n                          a.WithName(\"fluentgit\")\n                           .WithUrl(\"https://github.com/dazinator/fluentgit.git\")\n                           .WithFetchRefSpec(r =\u003e\n                               r.Source(\"refs/heads/master\")\n                                .Destination(\"refs/remotes/fluentgit/master\")\n                                .ForceUpdateIfFastForwardNotPossible()))\n                      .AddRemote(a =\u003e\n                          a.WithName(\"libgit2sharp\")\n                           .WithUrl(\"https://github.com/libgit2/libgit2sharp.git\")\n                           .WithFetchRefSpec(\"+refs/heads/master:refs/remotes/libgit2sharp/master\"))\n                      .UpdateRemote(r =\u003e r.Name == \"fluentgit\",\n                          u =\u003e\n                                u.ChangeUrlTo(\"https://sometherurl.com/fluentgit/fluentgit.git\")\n                                 .ChangeRefSpecs()\n                                    .Add(\"+refs/heads/development:refs/remotes/fluentgit/development\")\n                                        // can alternatively use RefSpecBuilder to build refspec strings:\n                                    .Add(b =\u003e\n                                        b.Source(\"refs/heads/qa\")\n                                         .Destination(\"refs/remotes/fluentgit/qa\")\n                                         .ForceUpdateIfFastForwardNotPossible())\n                                    .AddIfNotExists(\"+refs/heads/*:refs/remotes/fluentgit/*\")\n                                    .Remove(\"+refs/heads/somebranch:refs/remotes/somebranch\"))\n                      .UpdateRemoteIfExists(r =\u003e r.Url == \"non existing url\",\n                           u =\u003e\n                               // will only execute below update logic, if the remote in question exists.\n                                 u.ChangeUrlTo(\"http://someurl.com\")\n                                  .ChangeRefSpecs()\n                                     .Add(\"+whatever/*:whatever/*\")\n                                     .Remove(\"+blah/*:blah/*\"))\n                .WithBranch(\"development\")\n                  .CheckoutFile(\"readme.txt\")\n                  .CheckoutFileIfExists(\"licence.txt\")\n```\n\nThe above code should be self explanatory, but just in case - it demonstrates the following:-\n\n1. Performs a bare clone of a repo - using authentication credentials.\n2. Adds a remote named \"fluentgit\", with fetch refspecs (using refspec builder api)\n3. Adds another remote named \"libgit2sharp\" with fetch refspecs (using refspec specified as a string)\n4. Updates the \"fluentgit\" remote, to change it's URL, and also add in further fetch refspecs - as well as remove a fetch refspec.\n5. Updates the remote that has the url \"non existing url\" - if it exists, and adds and removes fetch ref specs.\n6. Switches to the \"development\" branch\n7. Checks out a \"readme.txt\" file\n8. If it exists, checks out a licence.txt file.\n\n## Under the hood\n\nFluentGit uses https://github.com/libgit2/libgit2sharp internally, and surfaces it in a fluent way. \n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdazinator%2Ffluentgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdazinator%2Ffluentgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdazinator%2Ffluentgit/lists"}