对于已从 github 移至私有 git.. 的回购,Capistrano 部署失败。仍在尝试联系 github.. 为什么?

Capistrano deploy fails for repo that was moved from github to private git.. stil trying to contact github.. why?

我有一个 Rails 4 项目,它从 github 开始,然后被移动到私有 git 存储库。我可以完美地使用 repo(推送、克隆)。我在代码中的某处搜索了对 github 存储库的引用,但 none 存在。它一定与 GIT 以及存储库的启动方式有关。

重要提示: 在删除 github 之前,我能够从我的私人存储库中使用此配置进行部署。

当然更新了config/deploy.rb

set :repo_url, '/srv/git/project.git'

运行 "git remote -v":

origin  git@git.server:/srv/git/project.git (fetch)
origin  git@git.server:/srv/git/project.git (push)

capistrano 日志 运行 "bundle exec cap production deploy":

00:00 git:wrapper
      01 mkdir -p /tmp
server's password:
    ✔ 01 server 6.019s
00:07 git:check
      01 git ls-remote --heads /srv/git/project.git
      01 6b0c9f5ad2d8e768902c5da1509fd99915068295       refs/heads/master
    ✔ 01 server 0.356s
00:07 deploy:check:directories
      01 mkdir -p /home/user/applications/project/shared /home/user/applications/project/releases
    ✔ 01 user@server 0.335s
00:08 deploy:check:linked_dirs
      01 mkdir -p /home/user/applications/project/shared/public/assets
    ✔ 01 user@server 0.331s
00:09 git:clone
      The repository mirror is at /home/user/applications/project/repo
00:10 git:update
      01 git remote update --prune
      01 Fetching origin
      01 remote: Invalid username or password.
      01 fatal: Authentication failed for 'https://github.com/user/project.git/'
      01 error: Could not fetch origin

不久前从 SVN 移动到 GIT,对此行为有点困惑。感谢任何帮助!

您必须更改服务器上的来源。完成此操作的最简单方法可能是通过 SSH 连接到服务器,导航到 /home/user/applications/project/repo 和:

git remote set-url origin /srv/git/project.git

我不相信 capistrano 会自动更新遥控器。