我设法在我的 NAS 上初始化了一个空的 git repo,我尝试通过生成一个新的公钥“foo.pub”并将其复制+粘贴到 keydir/ 并提交并将其推送到 NAS 来添加一个新用户.
首先,文件:
这是我的 ~/.ssh/config 文件:
Host root
HostName iptonas
User root
Port 123
Host foo
HostName iptonas
User foo
Port 123
identityfile ~/.ssh/foo
从 NAS 获取 gitolite-admin 的副本:
git clone ssh://root/gitolite-admin
我得到:
Cloning into 'gitolite-admin'...
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 12 (delta 1), reused 0 (delta 0)
Receiving objects: 100% (12/12), done.
Resolving deltas: 100% (1/1), done.
这是我的 gitolite.conf 文件:
repo gitolite-admin
RW+ = git
repo testing
RW+ = @all
repo newrepo
RW+ = foo
RW+ = bar
当我使用以下命令推送我的 gitolite-admin 副本时:
git push root:gitolite-admin
我得到:
Counting objects: 10, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 1.02 KiB, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: Initialized empty Git repository in /root/repositories/newrepo.git/
To root:gitolite-admin
897113c..e7e2daf master -> master
现在,当我尝试推送到新的仓库时
当我尝试运行时:
git clone foo:newrepo
我得到:
Cloning into 'newrepo'...
foo@iptonas's password:
fatal: 'newrepo' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
当我尝试运行时:
git clone root:newrepo
我得到:
Cloning into 'newrepo'...
FATAL: R any newrepo git DENIED by fallthru
(or you mis-spelled the reponame)
fatal: The remote end hung up unexpectedly
我不确定我做错了什么?
我遵循这些说明: http ://www.nineproductions.com/linux/53-gitolite-hosting.html 在“添加存储库和用户”下