【问题标题】:can't push file using gitolite无法使用 gitolite 推送文件
【发布时间】:2016-11-15 20:33:16
【问题描述】:

我在 ubuntu 机器上有一个 git 服务器,我已经安装了 gitolite 并且还克隆了 gitolite-admin 存储库,现在的问题是我无法推送或提取除 gitolite-admin 和 gitolite 提供的测试之外的其他存储库。

ADMIN@CSO49-PC MINGW64 /e/heena/heena/gitolite-admin (master)
$ git clone git@192.168.0.106:gitolite-admin
Cloning into 'gitolite-admin'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), done.
Checking connectivity... done.

ADMIN@CSO49-PC MINGW64 /e/heena/heena/gitolite-admin (master)
$ git push git@192.168.0.106:gitolite-admin
Everything up-to-date

ADMIN@CSO49-PC MINGW64 /e/heena/heena/gitolite-admin (master)
$ git push git@192.168.0.106:testing.git
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (6/6), 731 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 6 (delta 0)
To git@192.168.0.106:testing.git
 * [new branch]      master -> master

ADMIN@CSO49-PC MINGW64 /e/heena/heena/gitolite-admin (master)
$ git push git@192.168.0.106:cicd.git
FATAL: W any cicd admin DENIED by fallthru
(or you mis-spelled the reponame)
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

【问题讨论】:

  • 正如它所说,确保您没有拼错 repo 名称并且您拥有正确的访问权限。根据您的描述,我会说cicd.git repo 不存在。远程存储库必须已经存在才能推送到它,并且无法使用本地命令创建它。您必须在远程服务器上创建它(使用远程会话中的命令行或 Web 界面,如果远程服务器提供的话。)
  • 感谢 axiac,但它现在可以工作了,有一些小错误,但现在已经解决了
  • @HeenaPatel 您可以在下面发布您为解决这些错误所做的工作吗?
  • 我已经发布了答案,你应该检查一下

标签: git gitolite


【解决方案1】:

这很简单。

1.在 gitolite-admin repo 的 conf 文件夹中的 gitolite 文件中添加新的 repo。 2. 使用 git 命令 bash 添加它,提交并推送到 git 服务器 3. 现在参考新创建的 repo 触发 git 的常规命令。

以下是我在客户端执行的步骤

要添加新的 repo,heena

 repo gitolite-admin
RW+     =   admin

repo testing
RW+     =   @all

**repo heena
RW+     =   @all**

 ADMIN@CSO49-PC MINGW64 /e/heena/heena/gitolite-admin (master)
 $ cd conf

 ADMIN@CSO49-PC MINGW64 /e/heena/heena/gitolite-admin/conf (master)
 $ git add gitolite.conf

 ADMIN@CSO49-PC MINGW64 /e/heena/heena/gitolite-admin/conf (master)
 $ git commit -m"done" gitolite.conf
 [master 91ce8e2] done
  1 file changed, 1 insertion(+), 1 deletion(-)

 ADMIN@CSO49-PC MINGW64 /e/heena/heena/gitolite-admin/conf (master)
 $ git push git@192.168.0.106:gitolite-admin
 Counting objects: 4, done.
 Delta compression using up to 2 threads.
 Compressing objects: 100% (3/3), done.
 Writing objects: 100% (4/4), 363 bytes | 0 bytes/s, done.
 Total 4 (delta 1), reused 0 (delta 0)
remote: Initialized empty Git repository in /home/git/repositories/heena.git/

致 git@192.168.0.106:gitolite-admin 8fb8572..91ce8e2 主 -> 主

它在我的 git 服务器上创建了新的 repo

now 命令将文件推送到新创建的 repo heena.git

  ADMIN@CSO49-PC MINGW64 /e/heena/heena/cicd (master)
  $ ls
 sample.txt

ADMIN@CSO49-PC MINGW64 /e/heena/heena/cicd (master)
 $ git add sample.txt

ADMIN@CSO49-PC MINGW64 /e/heena/heena/cicd (master)

$ git push git@192.168.0.106:heena.git 计数对象:6,完成。 Delta 压缩最多使用 2 个线程。 压缩对象:100% (2/2),完成。 写入对象:100% (6/6),467 字节 | 0 字节/秒,完成。 总计 6 个(增量 0),重复使用 0 个(增量 0) 到 git@192.168.0.106:heena.git * [新分支] master -> master

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-10
    • 2023-03-05
    • 1970-01-01
    相关资源
    最近更新 更多