怎样在一台主机上使用多个git帐户?

105 views
Skip to first unread message

t w

unread,
Aug 19, 2011, 4:28:38 AM8/19/11
to Git中文用户组
我在github有两个帐户,一个是公司的,还有个是个人的,主要用于纪录一些代码心得.
我分别设置了user.name和user.email(没有使用全局参数)
但是在我git push的时候依然提示:
ERROR: Permission to 私人帐户名/study.git denied to 公司帐户名.
怎样解决这个问题?

Zheng Gao

unread,
Aug 19, 2011, 5:29:45 AM8/19/11
to git...@googlegroups.com

没设置ssh公钥什么的吧?

t w

unread,
Aug 19, 2011, 5:53:53 AM8/19/11
to Git中文用户组
的确,几个月前弄过,后来忘了,问题已经解决.谢谢!

Peter

unread,
Aug 21, 2011, 9:15:18 PM8/21/11
to git...@googlegroups.com
现在公司用git 也越来越多了:)

2011/8/19 t w <tws...@gmail.com>

Wendal Chen

unread,
Aug 21, 2011, 10:07:45 PM8/21/11
to git...@googlegroups.com
呵呵,我已经在公司推广git成功
--
Wendal Chen


Peter

unread,
Aug 22, 2011, 5:25:19 AM8/22/11
to git...@googlegroups.com
me too

2011/8/22 Wendal Chen <wenda...@gmail.com>

Donald

unread,
Aug 23, 2011, 1:24:29 AM8/23/11
to git...@googlegroups.com
怎么解决的,没有说方法啊。

2011/8/22 Peter <liuh...@gmail.com>



--
Regards,

Donald Wang

t w

unread,
Aug 23, 2011, 4:20:50 AM8/23/11
to Git中文用户组
默认一个机器上只有一个home位置,就是电脑上一个用户只能有一个id_rsa
但是eclipse的egit插件可以手动指定id_rsa.
现在公司项目就用msysgit,自己的东西就用eclipse的插件解决.不冲突.

yaroot

unread,
Aug 23, 2011, 4:53:50 AM8/23/11
to git...@googlegroups.com
# cat ~/.ssh/config
Host github_corp
Hostname github.com
IdentityFile ~/.ssh/corp_rsa_key

# git clone git@github_corp:corp/repo.git

openssh的功能.

2011/8/23 t w <tws...@gmail.com>:
> 默认一个机器上只有一个home位置,就是电脑上一个用户只能有一个id_rsa
> 但是eclipse的egit插件可以手动指定id_rsa.
> 现在公司项目就用msysgit,自己的东西就用eclipse的插件解决.不冲突.

Chunlin Zhang

unread,
Aug 23, 2011, 4:56:02 AM8/23/11
to git...@googlegroups.com
这个办法好!
我还不知道能这么设呢.

2011/8/23 yaroot <yar...@gmail.com>:

t w

unread,
Aug 23, 2011, 5:47:21 AM8/23/11
to Git中文用户组
受教了,还能这样,我在另外一个地方也发现了这个方法.
http://www.lainme.com/doku.php/blog/2011/01/%E4%BD%BF%E7%94%A8ssh_config

Peter

unread,
Aug 23, 2011, 10:21:49 AM8/23/11
to git...@googlegroups.com
好像我们 group 的人气越来越旺了 :)

2011/8/23 t w <tws...@gmail.com>

AleiPhoenix (A.K.A Areverie)

unread,
Aug 23, 2011, 11:09:07 AM8/23/11
to git...@googlegroups.com
毕竟Git没有一个比较像样的中文社区,希望这里能够成为吧:)

2011/8/23 Peter <liuh...@gmail.com>



--
The enemy is always yourself.

twitter: @areverie
wikipedia: AleiPhoenix
blog: weblog.areverie.org
wiki: wiki.areverie.org


Donald

unread,
Aug 23, 2011, 9:44:48 PM8/23/11
to git...@googlegroups.com
恩,感谢。

2011/8/23 t w <tws...@gmail.com>:

--
Regards,

Donald Wang

Peter

unread,
Aug 23, 2011, 10:29:46 PM8/23/11
to git...@googlegroups.com
我刚才看了一下,我们组有27个member。
真的不是一个小数字呀

2011/8/24 Donald <donal...@gmail.com>
Reply all
Reply to author
Forward
0 new messages