Git身份验证 - 作为新用户提取 [英] Git authentication - pull as a new user
问题描述
$ mkdir碳饼
$ cd碳饼
$ git init
$ git remote add origin gitosis@myserver.net:repositories / carboncake.git
$ git pull
但是,当我试图拉作为一个不同的用户,
$ mkdir carboncake
$ cd carboncake
$ git init
$ git remote add origin mithun@myserver.net:repositories / carboncake.git
$ git pull
我得到以下错误:
fatal:'repositories / carboncake。 git'似乎不是git仓库
fatal:远程终端意外挂起
my gitosis.conf
包含
[gitosis]
[group team]
writable = sweepshots
members = git_id_rsa
[group gitosis-admin]
writable = gitosis-admin
members = git_id_rsa
[回购carb oncake]
description =由Mithun提供的全新应用程序。
所有者= Mithun P
[组碳饼]
可写=碳饼
成员= mithun @core
和 keydir
包含
git_id_rsa.pub KEY ---- -.pub mithun.pub mithun-rsa-key-20110427.pub
和用户的 .ssh
dir包含
mithun @ testserver:〜$ ls .ssh /
id_rsa id_rsa.pub mithun_rsa mithun_rsa.pub
- UPDATE
我尝试了 $ git remote add origin mithun@myserver.net:carboncake.git
,但同样的错误。
其实carboncake.git位于 /srv/gitosis/repositories/carboncake.git
mithun@myserver.net
?
通过使用 mithun @ myserver.net
,你完全绕过gitosis,因为正确的url会涉及gitolite已经过去的' git
'用户每个gitosis命令都会涉及同一个'git'用户: gitosis@myserver.net
(假设这里是'gitosis'帐户)。
另外,您不必指定回购的完整路径:
git remote add origin gitosis@myserver.net:carboncake.git
The following set of commands worked correctly
$ mkdir carboncake
$ cd carboncake
$ git init
$ git remote add origin gitosis@myserver.net:repositories/carboncake.git
$ git pull
But when i tried pull as a different user,
$ mkdir carboncake
$ cd carboncake
$ git init
$ git remote add origin mithun@myserver.net:repositories/carboncake.git
$ git pull
I got the following error
fatal: 'repositories/carboncake.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
my gitosis.conf
contains
[gitosis]
[group team]
writable = sweepshots
members = git_id_rsa
[group gitosis-admin]
writable = gitosis-admin
members = git_id_rsa
[repo carboncake]
description = A brand new app by Mithun.
owner = Mithun P
[group carboncake]
writable = carboncake
members = mithun @core
and the keydir
contains
git_id_rsa.pub KEY-----.pub mithun.pub mithun-rsa-key-20110427.pub
and the user's .ssh
dir contains
mithun@testserver:~$ ls .ssh/
id_rsa id_rsa.pub mithun_rsa mithun_rsa.pub
-- UPDATE
I tried $ git remote add origin mithun@myserver.net:carboncake.git
too, but the same error.
Actually carboncake.git is located at /srv/gitosis/repositories/carboncake.git
mithun@myserver.net
?
By using mithun@myserver.net
, you are bypassing gitosis completely, since the correct url would involve the 'git
' user under which gitolite has been installed.
Every gitosis commands would involve the same 'git' user: gitosis@myserver.net
(assuming a 'gitosis' account here).
Plus, you shouldn't have to specify the full path of the repo:
git remote add origin gitosis@myserver.net:carboncake.git
这篇关于Git身份验证 - 作为新用户提取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!