{"id":28542660,"url":"https://github.com/petrgazarov/git-repo-name","last_synced_at":"2025-07-27T00:06:54.184Z","repository":{"id":281431779,"uuid":"880607750","full_name":"petrgazarov/git-repo-name","owner":"petrgazarov","description":"CLI tool that syncs your local git directory name with the remote repository name","archived":false,"fork":false,"pushed_at":"2025-03-24T15:33:44.000Z","size":239,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T21:48:19.721Z","etag":null,"topics":["automation","cli","git","github","repository-management","rust","synchronization"],"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/petrgazarov.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-10-30T02:40:45.000Z","updated_at":"2025-03-30T16:36:11.000Z","dependencies_parsed_at":"2025-03-09T03:24:58.093Z","dependency_job_id":"77884e38-e353-404d-8712-4ba838cc5027","html_url":"https://github.com/petrgazarov/git-repo-name","commit_stats":null,"previous_names":["petrgazarov/git-repo-name"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/petrgazarov/git-repo-name","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fgit-repo-name","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fgit-repo-name/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fgit-repo-name/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fgit-repo-name/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petrgazarov","download_url":"https://codeload.github.com/petrgazarov/git-repo-name/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrgazarov%2Fgit-repo-name/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267272902,"owners_count":24062521,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automation","cli","git","github","repository-management","rust","synchronization"],"created_at":"2025-06-09T20:35:02.490Z","updated_at":"2025-07-27T00:06:54.179Z","avatar_url":"https://github.com/petrgazarov.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-repo-name\n\n[![Unit tests](https://github.com/petrgazarov/git-repo-name/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/petrgazarov/git-repo-name/actions)\n\n`git-repo-name` is a CLI tool that syncs your local git directory name with the remote repository name.\n\nIt works bi-directionally and supports these two main use cases:\n\n- When you rename a repo on GitHub, run `git-repo-name pull` to update the local git directory name.\n- When you rename a local git directory, run `git-repo-name push` to rename the repo on GitHub.\n\nIn both cases, it makes an API call to GitHub, compares the repo name to the local directory name, and automatically renames the appropriate side.\n\n## Detailed Usage\n\n`git-repo-name` provides four main commands:\n\n```sh\ngit-repo-name pull    # Fetches repo name from the remote and renames local git directory name to match it\ngit-repo-name push    # Renames repo name on the remote with the local git directory name\ngit-repo-name fetch   # Fetches repo name from the remote without making changes\ngit-repo-name config  # Configures settings (GitHub token and default remote)\n```\n\n### pull\n\nFetches repo name from the remote and renames local git directory name to match it.\n\n_Note: For private GitHub repos, this requires a GitHub PAT (see [Configuration Keys](#configuration-keys) for more details)._\n\nExamples\n\n```bash\n# Basic usage\ngit-repo-name pull\n\n# Specify a remote [default: origin]\ngit-repo-name pull -r upstream\n\n# Preview what would happen without making changes\ngit-repo-name pull -n\n```\n\n### push\n\nRenames repo name on the remote with the local git directory name.\n\n_Note: For GitHub repos, this requires a GitHub PAT (see [Configuration Keys](#configuration-keys) for more details)._\n\nExamples\n\n```bash\n# Basic usage\ngit-repo-name push\n\n# Specify a remote [default: origin]\ngit-repo-name push -r upstream\n\n# Preview what would happen without making changes\ngit-repo-name push -n\n```\n\n### fetch\n\nFetches repo name from the remote without making changes.\n\nExamples\n\n```bash\n# Basic usage\ngit-repo-name fetch\n\n# Specify a remote [default: origin]\ngit-repo-name fetch -r upstream\n```\n\n### config\n\nConfigures settings.\n\n#### Configuration Keys\n\n- `default-remote`: The remote to use when none is specified (defaults to \"origin\")\n\n  Examples:\n\n  ```sh\n  # View default remote\n  git-repo-name config default-remote\n\n  # Set default remote\n  git-repo-name config default-remote upstream\n  ```\n\n- `github-token`: GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) for authenticating GitHub API requests.\n\n  Note: See the table below to determine the type of GitHub token you need and the permissions required.\n\n  | Scenario                                   | PAT type                | Permissions required                                                  |\n  | ------------------------------------------ | ----------------------- | --------------------------------------------------------------------- |\n  | Public repositories (`pull`/`fetch` only)  | N/A (no token required) | None                                                                  |\n  | Private repositories owned by you          | Fine-grained            | Metadata (read) for `pull`/`fetch`; Administration (write) for `push` |\n  | Organization repositories                  | Classic                 | repo scope                                                            |\n  | Mixed personal \u0026 organization repositories | Classic                 | repo scope                                                            |\n\n  Examples:\n\n  ```sh\n  # View GitHub token\n  git-repo-name config github-token\n\n  # Set GitHub token\n  git-repo-name config github-token ghp_your_token_here\n  ```\n\n## Installation\n\n### Homebrew (recommended)\n\n1. Install the `git-repo-name` formula:\n\n   ```bash\n   brew tap petrgazarov/git-repo-name\n   brew install git-repo-name\n   ```\n\n2. Add the following line to your shell startup file (e.g., `~/.bashrc` or `~/.zshrc`):\n\n   ```sh\n   source \"$(brew --prefix)/share/git-repo-name/git-repo-name.sh\"\n   ```\n\n### Direct binaries\n\nPre-compiled binaries are available on the [Releases page](https://github.com/petrgazarov/git-repo-name/releases).\n\nWhen downloading binaries directly, you'll need to manually set up shell integration:\n\n1. Download both the binary and the shell script from the releases page\n2. Make both files executable using:\n   ```bash\n   chmod +x /path/to/git-repo-name-bin /path/to/git-repo-name\n   ```\n3. Place the binary in your PATH as `git-repo-name-bin`\n4. Place the shell script in your PATH as `git-repo-name`\n5. Add the following line to your shell startup file (e.g., `~/.bashrc` or `~/.zshrc`):\n\n   ```sh\n   source \"$(which git-repo-name)\"\n   ```\n\n### Build from source\n\nAlternatively, you can clone this repository and build from source using Cargo:\n\n1. Install and build the binary:\n\n   ```bash\n   cargo install --git https://github.com/petrgazarov/git-repo-name.git\n   ```\n\n2. Rename the cargo-installed binary:\n\n   ```bash\n   mv $(which git-repo-name) $(dirname $(which git-repo-name))/git-repo-name-bin\n   ```\n\n3. Download the shell script from the repository and make it executable:\n\n   ```bash\n   curl -o /usr/local/bin/git-repo-name https://raw.githubusercontent.com/petrgazarov/git-repo-name/main/git-repo-name.sh\n   chmod +x /usr/local/bin/git-repo-name\n   ```\n\n   Replace `/usr/local/bin` with your preferred installation directory (ensure it's in your PATH).\n\n4. Add the following line to your shell startup file (e.g., `~/.bashrc` or `~/.zshrc`):\n\n   ```sh\n   source \"$(which git-repo-name)\"\n   ```\n\n## Supported remotes\n\n`git-repo-name` currently supports GitHub and file (bare) remotes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrgazarov%2Fgit-repo-name","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetrgazarov%2Fgit-repo-name","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrgazarov%2Fgit-repo-name/lists"}