{"id":16675238,"url":"https://github.com/chsxf/git-ssh-bash-scripts","last_synced_at":"2026-04-20T20:32:13.997Z","repository":{"id":246592192,"uuid":"821575303","full_name":"chsxf/git-ssh-bash-scripts","owner":"chsxf","description":"A collection of scripts to facilitate git repositories management with multiple SSH keys","archived":false,"fork":false,"pushed_at":"2024-06-28T22:11:15.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T21:47:31.228Z","etag":null,"topics":["git","shell-scripts","ssh"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/chsxf.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-06-28T21:32:17.000Z","updated_at":"2024-06-28T22:11:18.000Z","dependencies_parsed_at":"2024-06-28T22:39:46.808Z","dependency_job_id":"dfdeccc8-e0fd-4769-8621-684d987ce820","html_url":"https://github.com/chsxf/git-ssh-bash-scripts","commit_stats":null,"previous_names":["chsxf/git-ssh-bash-scripts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chsxf%2Fgit-ssh-bash-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chsxf%2Fgit-ssh-bash-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chsxf%2Fgit-ssh-bash-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chsxf%2Fgit-ssh-bash-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chsxf","download_url":"https://codeload.github.com/chsxf/git-ssh-bash-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243338011,"owners_count":20275400,"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","shell-scripts","ssh"],"created_at":"2024-10-12T12:46:01.139Z","updated_at":"2025-12-25T20:59:28.622Z","avatar_url":"https://github.com/chsxf.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About This Repository\n\nHave you ever tried to use multiple repositories from the same vendor (GitHub, BitBucket, GitLab, ...) but with different SSH keys? _Well, that's not easy._\n\nIndeed, your SSH agent will probably only support automatically one key per domain. However, you can assign specific keys to each repository with adequate git configuration settings ([`core.sshCommand`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-coresshCommand)).\n\nThis repository contains a collection of shell scripts to facilitate git repositories management with multiple SSH keys.\n\n# Scripts\n\nMost scripts will guide you through the process.\n\n## Add All SSH Keys to the Agent\n\nIn case your agent loses track of some of your keys, you can all them all at once with this script. Keys must be stored in `~/.ssh` (which is the default SSH folder).\n\nUsage:\n\n```shell\nssh-add-all-keys.sh\n```\n\n## Cloning a Repository\n\nClones a repository and assigns a SSH key to it. The specified repository will be cloned in a sub-folder.\n\nUsage:\n\n```shell\ngcssh \u003cgit_ssh_uri\u003e\n```\n\n## Adding a New Remote to an Existing Repsitory\n\nAdds a new remote to an existing repository and assign a specific SSH key to it. You must execute this script from the folder of the repository.\nUseful if the git repository has been initialized locally and not cloned.\n\nUsage:\n\n```shell\ngarssh \u003cgit_remote_ssh_uri\u003e\n```\n\n## Adding a Submodule to an Existing Repository\n\nAdds a submodule to an existing repository and assign a specific SSH to it. You must execute this script for the folder of the repository.\n\nUsage:\n\n```shell\ngasmssh \u003cgit_submodule_ssh_uri\u003e\n```\n\n## Initializing Submodules for an Existing Repository\n\nIn some cases, submodules must be initialized with the SSH key of the repository. This script is designed for that. You must execute this script for the folder of the repository.\n\nUsage:\n\n```shell\ngismssh\n```\n\n## Assign a SSH key to an Existing Repository\n\nThis script sets the SSH key to use for a repository. You must execute this script for the folder of the repository.\n\nUsage:\n\n```shell\ngsetsshcfg\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchsxf%2Fgit-ssh-bash-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchsxf%2Fgit-ssh-bash-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchsxf%2Fgit-ssh-bash-scripts/lists"}