{"id":16612875,"url":"https://github.com/ttys3/git-credential-readonly","last_synced_at":"2025-10-13T02:32:42.889Z","repository":{"id":204592846,"uuid":"613519182","full_name":"ttys3/git-credential-readonly","owner":"ttys3","description":"git-credential-readonly","archived":false,"fork":false,"pushed_at":"2024-08-11T04:57:39.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T02:32:02.039Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttys3.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}},"created_at":"2023-03-13T18:20:31.000Z","updated_at":"2024-08-11T04:57:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"beb45e87-959a-4b9f-908d-cca4051c1615","html_url":"https://github.com/ttys3/git-credential-readonly","commit_stats":null,"previous_names":["ttys3/git-credential-readonly"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ttys3/git-credential-readonly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fgit-credential-readonly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fgit-credential-readonly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fgit-credential-readonly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fgit-credential-readonly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttys3","download_url":"https://codeload.github.com/ttys3/git-credential-readonly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fgit-credential-readonly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014012,"owners_count":26085346,"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-10-13T02:00:06.723Z","response_time":61,"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":[],"created_at":"2024-10-12T01:45:12.686Z","updated_at":"2025-10-13T02:32:42.860Z","avatar_url":"https://github.com/ttys3.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-credential-readonly\n\nthis is a git credential helper that only reads from the credential store, and never writes to it.\n\nin a word, it is a drop-in replacement for `git-credential-store` that only handle `get` action, and silently ignore `store` and `erase`.\n\nit exists because the git built-in credential helper `store` will always write back to the credential store file.\n\nwhich will cause problem when you have different store config for both user personal token and organization personal token.\n\nfor example:\n\n```ini\n[credential \"https://github.com/org-name/\"]\n\thelper = readonly --file ~/.git-credentials-org\n\n[credential]\n\thelper = readonly\n```\n\nif you use `store` instead of `readonly`, it will always write back to the credential store file,\nwhich will cause problem after you use organization token,\nit will write the organization token back to the user credential store file.\nso you personal token (by default in `~/.git-credentials`) will be overwritten by the organization token.\ndue to both auth host name are the same.\n\n## install\n\n```shell\ngo install github.com/ttys3/git-credential-readonly@latest\n```\n\n```shell\nusage: `git-credential-readonly \u003cget|store|erase\u003e`\n```\n\n```shell\ngit config --global credential.helper readonly\n```\n## how to use with same host with diff token?\n\nthe credential.helper config sequence is important, git will match against it until it get the matched credentials.\n\nso organization specific token should goes first.\n\n```ini\n# organization specific token\n[credential \"https://github.com/your-org/\"]\n\thelper = readonly --file ~/.git-credentials-org\n\t# https://git-scm.com/docs/gitcredentials#Documentation/gitcredentials.txt-useHttpPath\n\t# uncomment below if you need match path by username or org name\n\t# for example: repo path `foo/bar.git`, will match path by `foo`\n\t#useHttpPath = true\n\n# general personal token\n[credential]\n\thelper = readonly\n\n[url \"https://github.com/\"]\n\tinsteadOf = git@github.com:\n```\n\nthe credential files:\n\n`~/.git-credentials-org`:\n\n```\nhttps://username:org-token@github.com\n```\n\n`~/.git-credentials`:\n\n```\nhttps://username:personal-token@github.com\n```\n\nyou can also use personal and org tokens in one file:\n\nthe config:\n\n```ini\n# github specific token\n[credential \"https://github.com/\"]\n\thelper = readonly --file ~/.git-credentials-org\n\t# https://git-scm.com/docs/gitcredentials#Documentation/gitcredentials.txt-useHttpPath\n\t# uncomment below if you need match path by username or org name\n\t# for example: repo path `foo/bar.git`, will match path by `foo`\n\tuseHttpPath = true\n```\n\nthe credential files:\n\n`~/.git-credentials-org`:\n\n```\nhttps://username:personal-token@github.com/username\nhttps://username:personal-token-for-org1@github.com/org-foo\nhttps://username:personal-token-for-org2@github.com/org-bar\n```\n\n## docs\n\nhttps://git-scm.com/book/en/v2/Git-Tools-Credential-Storage#_a_custom_credential_cache\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttys3%2Fgit-credential-readonly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttys3%2Fgit-credential-readonly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttys3%2Fgit-credential-readonly/lists"}