markdown 如何使用SSH密钥验证而不是密码验证来“获取”私有存储库。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 如何使用SSH密钥验证而不是密码验证来“获取”私有存储库。相关的知识,希望对你有一定的参考价值。

```bash
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
```

Sources:

- https://help.github.com/articles/which-remote-url-should-i-use #You can also use SSH agent forwarding with your deploy script to avoid managing keys on the server.
- http://golang.org/doc/faq #Why does "go get" use HTTPS when cloning a repository?
- https://www.kernel.org/pub/software/scm/git/docs/git-config.html #url.\<base\>.insteadOf

以上是关于markdown 如何使用SSH密钥验证而不是密码验证来“获取”私有存储库。的主要内容,如果未能解决你的问题,请参考以下文章