{"id":18715535,"url":"https://github.com/rawnly/gitgud","last_synced_at":"2025-06-29T16:36:20.992Z","repository":{"id":78840977,"uuid":"512906527","full_name":"rawnly/gitgud","owner":"rawnly","description":"Git library with DX in mind","archived":false,"fork":false,"pushed_at":"2023-04-17T15:21:54.000Z","size":36,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-19T11:46:01.840Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rawnly.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":"2022-07-11T20:56:28.000Z","updated_at":"2023-03-04T18:05:14.000Z","dependencies_parsed_at":"2023-05-28T05:30:44.555Z","dependency_job_id":null,"html_url":"https://github.com/rawnly/gitgud","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rawnly/gitgud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawnly%2Fgitgud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawnly%2Fgitgud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawnly%2Fgitgud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawnly%2Fgitgud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rawnly","download_url":"https://codeload.github.com/rawnly/gitgud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawnly%2Fgitgud/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262627188,"owners_count":23339521,"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":[],"created_at":"2024-11-07T13:09:09.364Z","updated_at":"2025-06-29T16:36:20.926Z","avatar_url":"https://github.com/rawnly.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gitgud\nA tiny library to run git commands.\n\nSometimes working with `exec.Cmd` might not be easy as expected. Here gitgud comes to help you.\nEvery command has a standard `Runnable` output. It is similar to the `exec.Cmd` interface but with some tweaking.\nIf you need more customisation you can always use the original `exec.Cmd` instance and tweak it yourself.\n\n## Features\n- Ease of use\n- Handle command errors\n- Supports custom `stderr`, `stdout` and `stdin`\n- Run directly in the terminal with `RunInTerminal`\n\n\n## Usage\n```shell\ngo get -u github.com/rawnly/gitgud\n```\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/rawnly/gitgud/git\"\n)\n\nfunc main() {\n\t// equivalent to \"git status -s\" \n\tstatus, err := git.Status(\u0026git.StatusOptions{\n\t\tShort: true,\n\t}).Output()\n\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\t\n\tfmt.Println(status)\n} \n```\n\nAdvanced Example\n```go\npackage main \n\nimport \"github.com/rawnly/gitgud/git\"\nimport \"os\"\n\nfunc main() {\n\tdiffCmd := git.Commit(\"docs(readme): updated example\", nil)\n\t\n\tstdout := \u0026bytes.Buffer{}\n\tstderr := \u0026bytes.Buffer{}\n\t\n\tdiffCmd.Cmd.Stdout = stdout\n\tdiffCmd.Cmd.Stderr = stderr\n\t\n\tif err := diffCmd.Run(); err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\n## Missing Something?\nIf you're missing some commands you can always use `run.Git` to manually run git commands.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/rawnly/gitgud/run\"\n)\n\nfunc main() {\n\t// equivalent to \"git status -s\" \n\tstatus, err := run.Git(\"status\", \"-s\").Output()\n\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\t\n\tfmt.Println(status)\n}\n```\n\n## Available Commands\n#### Start a working area\n- [x] Clone \n- [ ] Init\n\n#### Work on the current change\n- [x] Add _(partially done)_\n- [ ] Mv\n- [ ] Restore\n- [ ] Rm\n\n#### Examine the history and state\n- [x] Bisect\n- [ ] Diff\n- [ ] Grep\n- [ ] Log\n- [ ] Show \n- [x] Status\n\n#### Grow, mark and tweak your common history\n- [x] Branch\n- [x] Checkout\n- [x] Commit\n- [ ] Merge\n- [ ] Rebase\n- [ ] Reset\n- [ ] Switch\n- [ ] Tag\n\n#### Collaborate\n- [ ] Fetch\n- [x] Push\n- [ ] Pull\n\n#### Others\n- [x] Config, SetConfig\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawnly%2Fgitgud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frawnly%2Fgitgud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawnly%2Fgitgud/lists"}