Capistrano still trying to connect to my old repo

亡梦爱人 提交于 2020-01-05 04:36:09

问题


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

回答1:


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 git@github.com:REMOTE /var/www/apps/APPLICATION/shared/cached-copy && cd /var/www/apps/APPLICATION/shared/cached-copy && git checkout -q -b deploy HASH; fi"



回答2:


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://git@yourgitserver.org/username/reponame.git
 fetch = +refs/heads/*:refs/remotes/origin/*


来源:https://stackoverflow.com/questions/7725781/capistrano-still-trying-to-connect-to-my-old-repo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!