代码之家  ›  专栏  ›  技术社区  ›  NicholasJohn16

在satis存储库中使用本地repo

  •  6
  • NicholasJohn16  · 技术社区  · 6 年前

    我有一个服务器,其中有几个git repo和一个satis存储库设置。我想设置satis存储库以列出本地repo。

    // 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/"
    }
    

    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.git /var/repo/test-repo.git 对于回购url。当我这样做时,构建成功完成,但是当我试图使用composer时,我得到了以下错误。

    [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.  
    

    我怎样才能纠正?如有任何帮助,我们将不胜感激。

    仅供参考, git 是一个用户,并且有自己的ssh密钥,添加到 authorized_users 所以他们可以克隆自己的回购。

    1 回复  |  直到 6 年前
        1
  •  0
  •   sachin_ur    6 年前

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

    然后在小路下休憩

    C:\wamp\www\nj16\nicholasjohn16\vendor\NicholasJohn16\test-repo )

    并初始化空存储库

    git init

    git remote add composer github-url

    如果需要,则添加分支

    git branch slave

    然后结帐到从分支

    然后使用

    注1:请一个接一个地运行,然后您将知道失败是什么

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