{"id":15055432,"url":"https://github.com/mtibben/orgit","last_synced_at":"2025-04-10T03:41:02.984Z","repository":{"id":248045551,"uuid":"827602992","full_name":"mtibben/orgit","owner":"mtibben","description":"orgit is a cli tool for organising and syncing git repositories in a consistent and fast way.","archived":false,"fork":false,"pushed_at":"2024-07-30T23:26:23.000Z","size":105,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T04:51:40.478Z","etag":null,"topics":["clone","devops","git","github","gitlab","go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mtibben.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":"2024-07-12T01:58:17.000Z","updated_at":"2025-03-04T20:17:49.000Z","dependencies_parsed_at":"2024-07-12T03:21:32.101Z","dependency_job_id":"99a625a8-210b-4b83-9ff8-618eaee49dc5","html_url":"https://github.com/mtibben/orgit","commit_stats":null,"previous_names":["mtibben/orgit"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtibben%2Forgit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtibben%2Forgit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtibben%2Forgit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtibben%2Forgit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtibben","download_url":"https://codeload.github.com/mtibben/orgit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154963,"owners_count":21056541,"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":["clone","devops","git","github","gitlab","go"],"created_at":"2024-09-24T21:42:06.873Z","updated_at":"2025-04-10T03:41:02.959Z","avatar_url":"https://github.com/mtibben.png","language":"Go","readme":"# orgit\n\n`orgit` is a cli tool for organising and syncing git repositories in a consistent and fast way.\n\n\n## Why use `orgit`?\n\n`orgit` streamlines cloning git repos to a consistent location, and keeping them up-to-date. It's useful for developers who work with a large number of repositories within GitHub or GitLab orgs.\n\n`orgit`'s goals:\n  * sensible defaults: you can use it immediately without any special setup or config\n  * minimal config: it relies on the git CLI for all git operations, so all config that applies to git is respected\n  * fast: it uses concurrency wherever possible to parallise API and git operations\n  * small: a focussed feature-set, so it's easy to understand and use\n  * it just works: interoperable with popular git hosting services\n\n\n## How it works\n\n`orgit` organises your git repositories in your workspace directory in a tree structure that mirrors the URL structure of the remote git repository. For example, if you have a git repository with the URL `https://github.com/my-org/my-repo`, then `orgit` will clone it into `$ORGIT_WORKSPACE/github.com/my-org/my-repo`.\n\nThere are three commands.\n- `orgit get REPO_URL@COMMIT` will clone a repository using the repo's HTTP URL.\n- `orgit sync ORG_URL` will recursively clone or pull all repositories using the GitHub or GitLab org, user or group URL.\n- `orgit list` will list all git repositories in the workspace.\n\nNote that `orgit` always uses:\n - `origin` as the default remote\n - `https` as the git transport. To use SSH instead, override the URL in your `.gitconfig` (see example below)\n\n## Installing\n\nEither\n 1. download the latest release from the [releases page](https://github.com/mtibben/orgit/releases), or\n 2. install using your go toolchain: `go install github.com/mtibben/orgit@latest`.\n\n\n## Example use\n\n```shell\nexport ORGIT_WORKSPACE=~/Developer/src   # Set the orgit workspace. The orgit workspace is a directory that mirrors\n                                         # the remote repository URL structure.\norgit get github.com/my-org/my-project   # Clone a repo into $ORGIT_WORKSPACE/github.com/my-org/my-project\norgit sync github.com/my-org             # Clone all repos from the remote org in parallel\norgit list                               # List all local repos in the workspace\n```\n\n\n## Configuration\n\n- `ORGIT_WORKSPACE` can be set to a directory where you want to store your git repositories. By default it will use `~/orgit`\n- `GITLAB_HOSTS` can be set to a comma separated list of custom GitLab hosts\n- A `$ORGIT_WORKSPACE/.orgitignore` file can be used to ignore certain repos when using `orgit sync`. This file uses the same syntax as `.gitignore` files and also applies to remote repos.\n\n### Authentication\n\nIn order to use the `orgit sync` command, you'll need to use the GitHub or GitLab API. You can set up authentication for GitHub and GitLab using your `.netrc` file.\n\nFor example:\n```\nmachine github.com\n  login PRIVATE-TOKEN\n  password \u003cYOUR-GITHUB-PERSONAL-ACCESS-TOKEN\u003e\n\nmachine api.github.com\n  login PRIVATE-TOKEN\n  password \u003cYOUR-GITHUB-PERSONAL-ACCESS-TOKEN\u003e\n\nmachine gitlab.com\n  login PRIVATE-TOKEN\n  password \u003cYOUR-GITLAB-PERSONAL-ACCESS-TOKEN\u003e\n```\n\n\n## Tips\n\nA useful shell alias for changing directory to a repo using `fzf`\n```shell\nalias gcd=\"cd \\$(orgit list --full-path | fzf) \u0026\u0026 pwd\"\n```\n\nUsing shell autocompletion is useful, install it in your shell with `orgit completion`\n\nIf you wish to use SSH transport instead of HTTPS, you can override the URL in your `.gitconfig` file. For example:\n```ini\n[url \"git@github.com:\"]\n\tinsteadOf = https://github.com/\n[url \"git@gitlab.com:\"]\n\tinsteadOf = https://gitlab.com/\n```\n\n\n## TODO wanted features for v1\n - ~ignorefile like .gitignore~ done\n - ~Ctrl-C to cancel sync~ done\n - ~releases~ done\n - ~graceful shutdown~ done\n - ~fix error stats on graceful shutdown. Race condition, need to synchronise cancel and progress printer~\n - ~--tidy: - find directories not part of remote~\n - ~handle moved repos~\n - stage cloned repos so tidy can move existing repos\n - don't include skipped updates in stats\n - list --status --tree\n - oauth2 authentication\n - `@latest` = the tag with the highest semver version\n - better tests\n\n## Prior art and inspiration\n - https://gerrit.googlesource.com/git-repo\n - https://github.com/gabrie30/ghorg\n - https://github.com/x-motemen/ghq\n - https://gitslave.sourceforge.net/\n - https://github.com/orf/git-workspace\n - https://luke_titley.gitlab.io/git-poly/\n - https://github.com/grdl/git-get\n - https://github.com/fboender/multi-git-status\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtibben%2Forgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtibben%2Forgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtibben%2Forgit/lists"}