如何使用不同的帐户在 github 中开发同一个项目
how to develop the same project in github using the different accounts
我想和朋友一起开发一个项目。该项目在我的存储库中。如果我的伙伴可以在没有我的许可和代码审查的情况下直接使用他们自己的帐户将他们的代码提交到我的存储库?如何实现这一点?我需要一些细节。非常感谢。
你看过this了吗?您的伙伴可以提议文件更改。然后你所要做的就是接受它们。
最好的方法是为每个帐户添加多个 ssh 密钥,然后将它们添加到您的配置文件中。
https://gist.github.com/jexchan/2351996
create different public key
根据文章Mac 设置创建不同的 ssh 密钥 Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
例如,在以下位置创建了 2 个密钥:
~/.ssh/id_rsa_1
~/.ssh/id_rsa_2
Add these two keys to the ssh-agent:
$ ssh-add ~/.ssh/id_rsa_1
$ ssh-add ~/.ssh/id_rsa_2
you can delete all cached keys before
$ ssh-add -D
check your keys
$ ssh-add -l
Add the keys to the config file:
***
#activehacker account
Host github.com-1
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_1
#jexchan account
Host github.com-2
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_1
我想和朋友一起开发一个项目。该项目在我的存储库中。如果我的伙伴可以在没有我的许可和代码审查的情况下直接使用他们自己的帐户将他们的代码提交到我的存储库?如何实现这一点?我需要一些细节。非常感谢。
你看过this了吗?您的伙伴可以提议文件更改。然后你所要做的就是接受它们。
最好的方法是为每个帐户添加多个 ssh 密钥,然后将它们添加到您的配置文件中。
https://gist.github.com/jexchan/2351996
create different public key
根据文章Mac 设置创建不同的 ssh 密钥 Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
例如,在以下位置创建了 2 个密钥:
~/.ssh/id_rsa_1
~/.ssh/id_rsa_2
Add these two keys to the ssh-agent:
$ ssh-add ~/.ssh/id_rsa_1
$ ssh-add ~/.ssh/id_rsa_2
you can delete all cached keys before
$ ssh-add -D
check your keys
$ ssh-add -l
Add the keys to the config file:
***
#activehacker account
Host github.com-1
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_1
#jexchan account
Host github.com-2
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_1