首页 > 解决方案 > 在 satis 存储库中使用本地存储库

问题描述

我有一台服务器,其中有一些 git 存储库和一个满意的存储库设置。我想设置满足存储库以列出本地存储库。

// satis.json
{
  "name": "NJ16 Repositories",
  "homepage": "http://packages.example.com",
  "repositories": [
        { 
            "type": "vcs", 
            "url": "https://bitbucket.org/nicholasjohn16/example.git" 
        },
        {
            "type": "vcs",
            "url": "git@example.com:/var/repo/test-repo.git"
        }
  ],
  "require-all": true,
  "output-dir": "web/"
}

当我运行它时,bitbucket git repo 被成功访问和更新,但是当 satis 开始构建本地 git repo 时,它挂在以下行并且不会继续。

Executing command (/root/.cache/composer/vcs/git-example.com--repo-test-repo.git): git rev-parse --git-dir
Executing command (/root/.cache/composer/vcs/git-example.com--repo-test-repo.git): git remote -v
Executing command (/root/.cache/composer/vcs/git-example.com--repo-test-repo.git): git remote set-url origin 'git@example.com:/repo/test-repo.git' && git remote update --prune origin

我已经尝试使用../../repo/test-repo.gitand/var/repo/test-repo.git作为 repo url。当我这样做时,构建成功完成,但是当我尝试使用作曲家要求它时,我收到以下错误。

[RuntimeException]                                                                                                                      
Failed to execute git clone --no-checkout  "C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo" && cd /D "C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo" && git remote add composer  && git fetch composer

Cloning into 'test-repo'...                         
fatal: 'C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo' does not appear to be a git repository
fatal: Could not read from remote repository.                                                                                           

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

虽然,它确实引用了最近的提交哈希,所以我知道它至少成功地获取了 repo,但 satis 似乎无法访问数据。

我怎样才能正确地做到这一点?任何帮助表示赞赏。

JFYIgit是一个用户,拥有自己的 ssh 密钥,该密钥已添加到其中,authorized_users因此他们可以克隆自己的 repo。

标签: gitcomposer-phpsatis

解决方案


嗨,请确保您正在运行正确的命令和路径

然后在路径下方休耕

请转到您的回购路径(C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo

并初始化空存储库

git init

然后设置一个你想要的遥控器 git remote add composer github-url

然后根据需要添加一个分支

git branch slave

然后结帐到从分支

然后使用

注意1:请一个接一个运行然后你就会知道失败是什么

注意2:请重新检查您正在运行的命令

注3:放慢我的脚步


推荐阅读