Capistrano 仍在尝试连接到我的旧存储库

发布于 2024-12-09 00:10:48 字数 317 浏览 1 评论 0原文

我已将存储库从 Cadaset.com 更改为 Github.com,并将 deploy.rb 文件中的存储库设置更改为新的 Github 存储库。

当我运行 cap deploy 时,它仍然尝试连接到 Codaset.com 上的旧存储库。

我找不到任何对我的旧仓库的引用,所以不明白它为什么这样做。

我已经尝试过

cap deploy:setup

,但后来我得到了同样的错误

cap deploy

I have changed my repo to Github.com from Cadaset.com and changed the repository setting in my deploy.rb file to my new Github repo.

When I run cap deploy it still tries to connect to my old repo on Codaset.com.

I cant find any reference to my old repo so cant see why it is doing this.

I have tried

cap deploy:setup

that works but then I get the same error on

cap deploy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一世旳自豪 2024-12-16 00:10:48

您必须删除服务器上存储在 PATH_TO_APP/shared/cached-copy 中的共享副本。删除 cached-copy 目录并再次运行部署。

cached-copy 文件夹包含 Git 存储库的克隆。当克隆存在时,Capistrano 不会再次克隆它,而只是运行 git fetch

executing "if [ -d /var/www/apps/APPLICATION/shared/cached-copy ]; then cd /var/www/apps/APPLICATION/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard HASH && git clean -q -d -x -f; else git clone -q [email protected]:REMOTE /var/www/apps/APPLICATION/shared/cached-copy && cd /var/www/apps/APPLICATION/shared/cached-copy && git checkout -q -b deploy HASH; fi"

You have to delete the shared copy on your server stored at PATH_TO_APP/shared/cached-copy. Remove the cached-copy directory and run the deploy again.

The cached-copy folder contains a clone of your Git repository. When the clone exists, Capistrano doesn't clone it again and simply runs a git fetch.

executing "if [ -d /var/www/apps/APPLICATION/shared/cached-copy ]; then cd /var/www/apps/APPLICATION/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard HASH && git clean -q -d -x -f; else git clone -q [email protected]:REMOTE /var/www/apps/APPLICATION/shared/cached-copy && cd /var/www/apps/APPLICATION/shared/cached-copy && git checkout -q -b deploy HASH; fi"
听风吹 2024-12-16 00:10:48

如果 Simone 的答案不适合您,您可能需要手动编辑服务器上的 .git/config 文件以反映新“来源”的位置。查看本地计算机上应用程序项目中的源,并将源块镜像到服务器上“当前”文件夹中的 .git/config 中。这对我有用。

原始块看起来像

[remote "origin"]
 url = ssh://[email protected]/username/reponame.git
 fetch = +refs/heads/*:refs/remotes/origin/*

If Simone's answer doesn't do it for you, you may have to manually edit your .git/config file on your server to reflect the location of the new 'origin'. Have a look at your origin in your application project on your local machine, and mirror the origin block in the .git/config in the 'current' folder on your server. This worked for me.

The origin block will look something like

[remote "origin"]
 url = ssh://[email protected]/username/reponame.git
 fetch = +refs/heads/*:refs/remotes/origin/*
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文