Capistrano still trying to connect to my old repo

2019-08-14 04:45发布

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

2条回答
Viruses.
2楼-- · 2019-08-14 05:14

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"
查看更多
叛逆
3楼-- · 2019-08-14 05:31

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/*
查看更多
登录 后发表回答