{"id":16788781,"url":"https://github.com/ayakovlenko/zit","last_synced_at":"2025-03-17T03:30:21.913Z","repository":{"id":49020252,"uuid":"254604053","full_name":"ayakovlenko/zit","owner":"ayakovlenko","description":"git identity manager","archived":false,"fork":false,"pushed_at":"2025-02-27T07:22:53.000Z","size":90,"stargazers_count":32,"open_issues_count":9,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-27T09:43:03.572Z","etag":null,"topics":["configuration-management","git","git-identity"],"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/ayakovlenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2020-04-10T10:10:25.000Z","updated_at":"2025-02-27T07:06:04.000Z","dependencies_parsed_at":"2024-04-26T17:25:47.316Z","dependency_job_id":"453d3040-4f95-4efb-856d-bdc9e421805f","html_url":"https://github.com/ayakovlenko/zit","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayakovlenko%2Fzit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayakovlenko%2Fzit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayakovlenko%2Fzit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayakovlenko%2Fzit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayakovlenko","download_url":"https://codeload.github.com/ayakovlenko/zit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841203,"owners_count":20356441,"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":["configuration-management","git","git-identity"],"created_at":"2024-10-13T08:24:46.133Z","updated_at":"2025-03-17T03:30:21.906Z","avatar_url":"https://github.com/ayakovlenko.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zit\n\n_git identity manager_\n\n## How it works\n\n_zit_ chooses a git identity based on:\n\n1. git remote host\n2. repository owner\n3. repository name\n\n… as defined in the configuration file:\n\n```yaml\n# Example config\n---\nusers:\n  work: \u0026work_user\n    name: \"John Doe\"\n    email: \"john.doe@corp.com\"\n\n  personal:\n    github_user: \u0026personal_github_user\n      name: \"JD42\"\n      email: \"JD42@users.noreply.github.com\"\n      sign:\n        key: \"~/.ssh/id_ed25519_github.pub\"\n        format: \"ssh\"\n\n    gitlab_user: \u0026personal_gitlab_user\n      name: \"JD42\"\n      email: \"786972-JD42@users.noreply.gitlab.com\"\n\nhosts:\n  github.com:\n    default: *personal_github_user\n    overrides:\n      - owner: \"corp\"\n        user: *work_user\n\n  gitlab.com:\n    default: *personal_gitlab_user\n```\n\n## Setup\n\nThere are 2 ways to set up a configuration file:\n\n1. Place it in\n   [XDG_CONFIG_HOME](https://specifications.freedesktop.org/basedir-spec/0.6/)\n   location: `$XDG_CONFIG_HOME/zit/config.yaml`\n2. Place it in `.config` location: `$HOME/.config/zit/config.yaml`\n\nAlternatively, run:\n\n```sh\nzit config init\n\nvim $(zit config path)\n```\n\n## Usage\n\nTo set up an identity, run `zit set` inside a repo directory:\n\n```bash\n$ zit set  # personal repo\nset user: jdoe \u003cjdoe@users.noreply.github.com\u003e\nset signing key: ssh key at ~/.ssh/id_ed25519_github.pub\n\n$ git remote get-url origin\nhttps://github.com/jdoe/repo.git\n```\n\n```bash\n$ zit set  # work repo\nset user: John Doe \u003cjohn.doe@corp.com\u003e\n\n$ git remote get-url origin\ngit@github.corp.com:team/repo.git\n```\n\n**Note**: Use `--dry-run` flag to test which identity will be used without\napplying it.\n\n## Installation\n\n**On Mac/Linux with Homebrew**\n\n```bash\nbrew tap ayakovlenko/tools\nbrew install ayakovlenko/tools/zit\n```\n\n**From sources**\n\n```bash\ngit clone https://github.com/ayakovlenko/zit.git\ncd zit\ngo install\n```\n\n**From binaries**\n\nDownload binaries from the\n[releases](https://github.com/ayakovlenko/zit/releases) page.\n\n## Setup\n\n**Remove any existing global identity**\n\n```bash\ngit config --unset-all --global user.name\ngit config --unset-all --global user.email\ngit config --unset-all --system user.name\ngit config --unset-all --system user.email\n```\n\n**Require config to exist in order to make commits**\n\n```bash\ngit config --global user.useConfigOnly true\n```\n\nWithout the global user name and user email, git would use the system's hostname\nand username to make commits. Tell git to throw an error instead, requiring you\nto specify an identity for every new project.\n\nRun `zit doctor` to make sure the system is configured correctly:\n\n```bash\n$ zit doctor\n- [x] git config --global user.useConfigOnly true\n- [x] git config --unset-all --global user.name\n- [x] git config --unset-all --global user.email\n- [x] git config --unset-all --system user.name\n- [x] git config --unset-all --system user.email\n```\n\n## Contributing\n\nIf you feel you can contribute to this project, or you've found a bug, create an issue or pull request.\n\nThis project is soley mantained, so it is prone to bugs and anti-patterns, please call them out.\n\nAll contributions are highly appreciated!\n\n[![](https://api.star-history.com/svg?repos=ayakovlenko/zit\u0026type=Date)](https://star-history.com/#ayakovlenko/zit\u0026Date)\n\n### Contributors\n\n- [@arjunrn](https://github.com/arjunrn)\n- [@etolmach](https://github.com/etolmach)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayakovlenko%2Fzit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayakovlenko%2Fzit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayakovlenko%2Fzit/lists"}