使用以下链接创建 ssh 密钥(https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)使用创建 ssh 密钥后git bash 并添加到 github。它仅适用于特定的 git bash。如果我关闭 git bash 并再次打开。相同的 ssh 密钥不起作用,需要创建新的。谁能告诉我为什么会这样?或者缺少什么?
当您打开 Git Bash 时,您需要自动将 ssh 密钥添加到每个会话。为此,如果您使用的是 Windows,请按照以下步骤操作:
C:\Program Files\Git\etc\ssh)ssh_config文件并添加一行IdentityFile Drive:\path\to\key,其中Drive:\path\to\key应指定您之前生成的密钥的本地路径,并在编辑后保存文件。现在,每次打开 Git Bash 时,密钥都会自动添加到 ssh 会话中,您无需每次都添加 ssh 密钥。