Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change repo_url #1227

Closed
stamm opened this issue Dec 15, 2014 · 7 comments
Closed

change repo_url #1227

stamm opened this issue Dec 15, 2014 · 7 comments

Comments

@stamm
Copy link
Contributor

stamm commented Dec 15, 2014

If I change repo_url, capistrano still clone code from old repo.
In file repo/config origin also from old repo.

I remove directory repo, and it works with new repo

@leehambley
Copy link
Member

Closing because I’m not sure this is an issue, if you are convinced that this is really a bug, please feel free to re-open the issue and add more information (your versions (Ruby, Cap, etc), your Capfile, your logs, and relevant sections out of your Gemfile)

Otherwise support is done via the mailing list (https://groups.google.com/forum/#!forum/capistrano) or at StackOverflow (http://stackoverflow.com/questions/tagged/capistrano) with questions tagged capistrano.

@jomo
Copy link

jomo commented Mar 23, 2015

FTR, had the same issue, found the solution on StackOverflow.

@will-in-wi
Copy link
Contributor

I've run into this several times. The solution in each case is just to nuke the repo directory. This isn't an issue when it is just one server, but in one case I'm deploying to 6 servers. However, changing the repo url is rather uncommon, so it is most just an annoyance.

For a workaround, try this: https://rubygems.org/gems/capistrano-git-delete_repo

@will-in-wi
Copy link
Contributor

As I was reading the comments in the link above, I noted that someone suggested this:

namespace :git do
  task :update_repo_url do
    on roles(:all) do
      within repo_path do
        execute :git, 'remote', 'set-url', 'origin', fetch(:repo_url)
      end
    end
  end
end

This might be worth making a standard part of the Git deployment workflow. I doubt that it would take long on deploy, and might solve this issue.

@leehambley
Copy link
Member

I can't see what version of Git that was added to - I'll check the changelogs - https://git-scm.com/docs/git-remote

@ringowang
Copy link

@stamm Thank you! I deleted dir repo and it solved my problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants