{"id":25183983,"url":"https://github.com/thoroc/git-mirror","last_synced_at":"2026-05-06T11:37:22.895Z","repository":{"id":276269364,"uuid":"928765333","full_name":"thoroc/git-mirror","owner":"thoroc","description":"Git utility to clone a repo from anywhere on the file system to your regular project directory while mirroring the remote path","archived":false,"fork":false,"pushed_at":"2026-02-07T00:01:30.000Z","size":52973,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-07T01:43:25.502Z","etag":null,"topics":["deno","git","typescript"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/thoroc.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-07T07:43:16.000Z","updated_at":"2026-02-07T00:01:32.000Z","dependencies_parsed_at":"2025-03-05T09:35:33.432Z","dependency_job_id":null,"html_url":"https://github.com/thoroc/git-mirror","commit_stats":null,"previous_names":["thoroc/git-mirror"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/thoroc/git-mirror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoroc%2Fgit-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoroc%2Fgit-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoroc%2Fgit-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoroc%2Fgit-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoroc","download_url":"https://codeload.github.com/thoroc/git-mirror/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoroc%2Fgit-mirror/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32692488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","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":["deno","git","typescript"],"created_at":"2025-02-09T19:19:48.475Z","updated_at":"2026-05-06T11:37:22.890Z","avatar_url":"https://github.com/thoroc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-mirror\n\n[![CI](https://github.com/thoroc/git-mirror/actions/workflows/ci.yml/badge.svg)](https://github.com/thoroc/git-mirror/actions/workflows/ci.yml)\n[![Version](https://img.shields.io/badge/version-0.4.0-blue)](https://github.com/thoroc/git-mirror/releases)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n[![Rust](https://img.shields.io/badge/built%20with-Rust-orange)](https://www.rust-lang.org/)\n\nRust CLI to clone a GitHub/GitLab (or other Git) repo to `~/Projects` while keeping a tree\nstructure close to the remote URL. If the project already exists locally the CLI can\nbe used to print commands for updating or changing directory instead of cloning.\n\n## Why use git-mirror?\n\nOrganizing cloned repositories consistently is tedious. git-mirror automates this by:\n\n- **Smart directory structure** - Mirrors the remote URL structure locally (`~/Projects/github/owner/repo`)\n- **Works with any Git host** - GitHub, GitLab, Bitbucket, or self-hosted instances\n- **Shell integration** - Print `cd` commands to jump straight into cloned repos\n- **VS Code ready** - Optionally open repos in VS Code immediately after cloning\n- **Fast and lightweight** - Written in Rust for maximum performance\n\n## Install\n\n### Quick Install (Recommended)\n\nInstall via the automated installation script:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/thoroc/git-mirror/main/install.sh | bash\n```\n\nThis will:\n- Detect your OS and architecture automatically\n- Download the latest release binary\n- Verify the checksum for security\n- Install to `~/.local/bin/git-mirror` (or custom location via `INSTALL_DIR` env var)\n\nCustom installation directory:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/thoroc/git-mirror/main/install.sh | INSTALL_DIR=/usr/local/bin bash\n```\n\n### Manual Installation\n\nDownload the appropriate binary for your system from the [latest release](https://github.com/thoroc/git-mirror/releases/latest):\n\n- **Linux x86_64**: `git-mirror-linux-x86_64.tar.gz`\n- **Linux ARM64**: `git-mirror-linux-aarch64.tar.gz`\n- **macOS Intel**: `git-mirror-macos-x86_64.tar.gz`\n- **macOS Apple Silicon**: `git-mirror-macos-aarch64.tar.gz`\n- **Windows**: `git-mirror-windows-x86_64.zip`\n\nExtract and move to a directory in your `PATH`:\n\n```sh\n# Linux/macOS example\ntar -xzf git-mirror-*.tar.gz\nmv git-mirror ~/.local/bin/\nchmod +x ~/.local/bin/git-mirror\n```\n\n### Build from Source\n\nBuild and install locally with Cargo:\n\n```sh\ncargo install --path .\n```\n\nThis installs a `git-mirror` binary in your Cargo bin directory (usually `~/.cargo/bin`).\n\nAlternatively during development run via:\n\n```sh\ncargo run -- \u003crepo\u003e --print-cd\n```\n\n### Git Alias (Optional)\n\nTo add a Git alias for convenience, add to your `~/.gitconfig`:\n\n```toml\n[alias]\n  mirror = \"!git-mirror\"\n```\n\nAfter installing, you can call `git-mirror` directly (or `git mirror` if you set the alias).\n\n## Prerequisites\n\n- `git` installed and available on your `PATH`.\n- Rust toolchain (`rustc` and `cargo`) if you want to build from source.\n- SSH keys configured for SSH-style remotes (if using `git@...` URLs).\n\n## Quick start\n\nClone using SSH (common):\n\n```sh\ngit-mirror git@github.com:owner/repo.git\n```\n\nClone using HTTPS:\n\n```sh\ngit-mirror https://github.com/owner/repo.git\n```\n\nClone from GitLab (example):\n\n```sh\ngit-mirror git@gitlab.com:group/project.git\n```\n\nTo just print a `cd` command you can evaluate the output in your shell:\n\n```sh\neval \"$(git-mirror git@github.com:owner/repo.git --print-cd)\"\n```\n\n## Usage\n\nBasic CLI options:\n\n- `-r, --root \u003cROOT\u003e`     - Root directory where projects are stored (default: `~/Projects`).\n  Example: `git-mirror --root ~/Work git@github.com:owner/repo.git`\n- `--print-cd`            - Print a shell-friendly `cd` command pointing to the repo local path.\n  Example: `git-mirror --print-cd git@github.com:owner/repo.git`\n- `--dry-run`             - Dry run: show commands without executing.\n  Example: `git-mirror --dry-run git@github.com:owner/repo.git`\n- `--open-vs-code`        - Open the repo in VS Code after cloning or when it already exists.\n  Example: `git-mirror --open-vs-code git@github.com:owner/repo.git`\n- `--no-open-vs-code`     - Do not open the repo in VS Code.\n  Example: `git-mirror --no-open-vs-code git@github.com:owner/repo.git`\n- `--no-prompt`           - Disable interactive prompts (useful in CI).\n  Example: `git-mirror --no-prompt git@github.com:owner/repo.git`\n- `--full-host`           - Use the full host domain in the local path (e.g. `github.com` instead of `github`).\n  Example: `git-mirror --full-host git@github.com:owner/repo.git`\n\nNotes:\n\n- The CLI cannot change your parent shell's working directory. To have your interactive\n  shell move into the cloned repo automatically, evaluate the CLI output in your shell.\n\n  Bash / Zsh example:\n\n  ```sh\n  eval \"$(git-mirror git@github.com:owner/repo.git --print-cd)\"\n  ```\n\n  Fish example:\n\n  ```fish\n  eval (git-mirror git@github.com:owner/repo.git --print-cd)\n  ```\n\n- If you want only the `cd` (without opening an editor), use `--print-cd`.\n\n## Shell helpers\n\nCopy-paste helper functions for your shell.\n\nBash / Zsh:\n\n```sh\ngit_mirror_cd() {\n  eval \"$(git-mirror \"$1\" --print-cd ${2:+--root \"$2\"})\"\n}\n```\n\nFish:\n\n```fish\nfunction git_mirror_cd\n  set -l repo $argv[1]\n  set -l root_arg ''\n  if test (count $argv) -ge 2\n    set root_arg \"--root $argv[2]\"\n  end\n  eval (git-mirror $repo --print-cd $root_arg)\nend\n```\n\nPowerShell:\n\n```powershell\nfunction Git-Mirror-Cd {\n  param([string]$Repo, [string]$Root)\n  if ($Root) {\n    $cmd = git-mirror $Repo --print-cd --root \"$Root\"\n  } else {\n    $cmd = git-mirror $Repo --print-cd\n  }\n  Invoke-Expression $cmd\n}\n```\n\n## Notes \u0026 Migration\n\n- This repo previously contained a Deno/TypeScript implementation, which has been replaced with the current Rust implementation.\n- The Rust CLI implements core features: host parsing, local path construction, `git clone`, VS Code integration, and interactive prompts.\n\n### Migration notes (host-name change)\n\nThe Rust implementation uses a short host label by default when constructing the\nlocal path. For example:\n\n- `git@github.com:owner/repo.git` -\u003e `~/Projects/github/owner/repo`\n\nIf you prefer the full domain (e.g. `github.com`) in the local path, use the\n`--full-host` flag:\n\n```sh\ngit-mirror --full-host git@github.com:owner/repo.git\n# =\u003e ~/Projects/github.com/owner/repo\n```\n\nIf you are migrating from an earlier implementation that used the full domain\nin local paths, consider running a one-time move of your directories or cloning\nwith `--full-host` to keep the old layout.\n\nIf you want me to add an automatic migration helper (move directories and create\nsymlinks), say so and I can implement it.\n\n---\n\nDeveloper and contributor information has moved to `CONTRIBUTING.md`.\n\nSee `CONTRIBUTING.md` for release automation, contributing, and troubleshooting details.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoroc%2Fgit-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoroc%2Fgit-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoroc%2Fgit-mirror/lists"}