/git-ssh-key

manager multi git ssh keys in one machine, with serval private or public repo.

Primary LanguagePythonApache License 2.0Apache-2.0

git-ssh-key

manager multi git repo ssh keys in one machine, with multi private or public repo.

this command will auto generate the key and add it to your ssh config

usage

pip install git-ssh-key

run command with your repo link like

git-ssh-key https://github.com/alingse/git-ssh-key.git

it will print the new alias repo link and the new public key,

New repo address: git@github.com-f5851eb:alingse/git-ssh-key.git
New repo public rsa key: /Users/alingse/.ssh/github.com-f5851eb.id_rsa.pub

the public key has already been configured in your ssh config file, remember add it to repo's setting keys (https://github.com/user/repo/settings/keys)

and then just clone like this

git clone git@github.com-f5851eb:alingse/git-ssh-key.git

more options see

git-ssh-key --help
git-ssh-key -c git.ssh.config --keys ./../ -t web-backend git@github.com:alingse/git-ssh-key.git

How it work

I ever see some stackoverflow and github gist, and just make them a tool

git-ssh-key will read .ssh/config (default) and write into an alias host config.

like this

Host github.com-f5851eb
HostName github.com
User git
IdentityFile /Users/alingse/.ssh/github.com-f5851eb.id_rsa

the f5851eb is tag, default generate by hash(url)

Develop

pdm see https://pdm.fming.dev/

pdm install

pdm build

pdm run git-ssh-key --help

publish

add once

pdm config publish.username xxx
pdm config publish.password yyy
pdm publish

more TODO

  1. show public key ?
  2. add more test ?
  3. better giturlparse