{"id":13558580,"url":"https://github.com/madx/git-identity","last_synced_at":"2025-04-15T18:30:22.993Z","repository":{"id":6512598,"uuid":"7753359","full_name":"madx/git-identity","owner":"madx","description":"Manage your identity in Git","archived":false,"fork":false,"pushed_at":"2022-03-27T20:08:24.000Z","size":44,"stargazers_count":118,"open_issues_count":0,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T23:34:04.426Z","etag":null,"topics":["git","git-addons","identity-manager","plugin"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madx.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}},"created_at":"2013-01-22T14:04:53.000Z","updated_at":"2025-02-12T14:34:21.000Z","dependencies_parsed_at":"2022-09-07T03:21:14.113Z","dependency_job_id":null,"html_url":"https://github.com/madx/git-identity","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madx%2Fgit-identity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madx%2Fgit-identity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madx%2Fgit-identity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madx%2Fgit-identity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madx","download_url":"https://codeload.github.com/madx/git-identity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249128793,"owners_count":21217219,"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":["git","git-addons","identity-manager","plugin"],"created_at":"2024-08-01T12:05:02.690Z","updated_at":"2025-04-15T18:30:22.974Z","avatar_url":"https://github.com/madx.png","language":"Shell","funding_links":[],"categories":["Shell","git"],"sub_categories":[],"readme":"git-identity\n============\n\nYou often use Git in different contexts, like at work and for open-source\nprojects. You may then want to use different user names/email pairs to identify\nyourself.\n\nThis is not an important part of your work, and setting this up should be really\nfast. That's where `git-identity` comes in: setting up your identity information only takes one command with it.\n\n*Note:* Identities are stored in the global git config. Using an identity copies the setting in the local repo git configuration. If you are changing the global config for one identity does *NOT* propagate the changes to the local repos. You will have use `git identity --update` in the repo folder to update the identity.\n\nInstalling\n----------\n\nSimply link or copy the `git-identity` in a directory that's in your `PATH`, Git\nwill pick it up and make it available as `git identity`.\n\n    $ ln -s git-identity ~/bin/git-identity\n\nUnder Windows, go to System \u003e Advanced System Parameters \u003e Environment Variable. Find the \"Path\" entry under *system variables* and add the path to where you downloaded `git-identity`.\n\nThen you may setup a default identity with the following command (see Usage for more information):\n\n    $ git identity --define default Me me@example.org\n\nTo get bash completion, just source the `git-identity.bash-completion` file\nin your initialization scripts, such as `.bashrc`.\n\nTo get zsh completion, move the `git-identity.zsh-completion` file to a location present in your `$FPATH`, renaming the file to `_git-identity`.\n\nYou can also use [basher](https://github.com/basherpm/basher) to install git-identity:\n\n    $ basher install madx/git-identity\n\nUsage\n-----\n\nAdd an identity:\n\n    $ git identity --define \u003cidentity name\u003e \u003cuser name\u003e \u003cuser email\u003e [\u003cssh-file\u003e] [\u003cgpgkeyid\u003e]\n\nAdd a GPG key to the identity (see GPG specific information below)\n\n\t$ git identity --define-gpg \u003cidentity name\u003e \u003cgpgkeyid\u003e\n\tAdded GPG key DA221397A6FF5EZZ to [default] user \u003cuser@example.org\u003e (GPG key: DA221397A6FF5EZZ)\n\nAdd a SSH key to the identity\n\n\t$ git identity --define-ssh \u003cidentity name\u003e \u003cssh-file\u003e\n\tAdded SSH key id_rsa_anotheraccount to [default] user \u003cuser@example.org\u003e (SSH key: id_rsa_anotheraccount)\n\nPrint the current identity:\n\n    $ git identity\n    Current identity: [default] user \u003cuser@example.org\u003e\n\nChange identity:\n\n    $ git identity user2\n    Using identity: [default2] user2 \u003cuser2@example.org\u003e\n\nUpdate identity:\n\n    $ git identity --update\n    Using identity: [user] First Last \u003cuser_new_email@example.com\u003e (SSH key: id_rsa_user_new_key)\n    These are the changes:\n    1,2c1,2\n    \u003c   core.sshcommand ssh  -i ~/.ssh/id_rsa_user\n    \u003c   user.email user@example.com\n    ---\n    \u003e   core.sshcommand ssh  -i ~/.ssh/id_rsa_user_new_key\n    \u003e   user.email user_new_email@example.com\n\nList all identities:\n\n    $ git identity --list\n    Available identities:\n    [default] user \u003cuser@example.org\u003e\n    [default2] user2 \u003cuser2@example.org\u003e\n\nListing raw identities:\n\n    $ git identity --list-raw\n    default\n    default2\n\nDeleting an identity:\n\n    $ git identity --remove \u003cidentity name\u003e\n\nPrinting the raw identity (for use in scripts)\n\n    $ git identity --print\n    $ git identity --print \u003cidentity name\u003e\n\nPriniting the local settings\n\n    $ git identity --get-settings\n    core.sshcommand ssh -i ~/.ssh/id_rsa_user\n    user.email user@example.com\n    user.identity user\n    user.name First Last\n\nRetriving GIT_SSH_COMMAND or running command with that in the environment:\n\n    $ git identity -c my_other_identity\n    GIT_SSH_COMMAND=\"ssh -i ~/.ssh/id_rsa_myotheridentity\"\n\n    $ git identity -c my_other_identity git clone git@github.com:me/myrepo.git\n    Cloning into 'myrepo'...\n\nSetting up GPG\n--------------\n\nMore information about how to use GPG with `git-identity` may be found in [GPG_SETUP.md](GPG_SETUP.md)\n\nSetting up SSH\n--------------\n\nIf you have a valid SSH key associate to the agent you do not have to do anything beside `git identity --define-ssh \u003cidentity name\u003e \u003cssh-file\u003e`.\n\nThis sets  `core.sshCommand=\"ssh -i ~/ssh/ssh-file\"` in the local git config when using that identity\n\n### Creating a new identity \n\n        ssh-keygen -t rsa -b 4096 -C \"yourname@yourdomain\" -f ~/.ssh/id_rsa_anotheraccount\n    ssh-add id_rsa_anotheraccount\n\n### Debugging a ssh connection problem \n\n    git identity --define-ssh \u003cidentity name\u003e \u003cssh-file\u003e \u003cverbosity\u003e\n\nWith `verbosity=1` it will use `ssh -v`.\nWith `verbosity=2` it will use `ssh -vvv`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadx%2Fgit-identity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadx%2Fgit-identity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadx%2Fgit-identity/lists"}