4

I'm using git to track a SVN repository. It's all working fine, but now the domain name of the repository changed and I need to commit my changes back to SVN. Except for git svn rebase & git svn dcommit wont work since the domain name has changed. How can I change the repository to track the new location? I already tried editing .git/config SVN URL, but that won't work.

svick
  • 236,525
  • 50
  • 385
  • 514
  • possible duplicate of [git-svn: what's the equivalent to \`svn switch --relocate\`?](http://stackoverflow.com/questions/268736/git-svn-whats-the-equivalent-to-svn-switch-relocate) – svick May 22 '13 at 18:13

3 Answers3

3

This site says you need to create a new git-svn clone from the new svn URL, then copy any local changes into it.

You could try GitSvnSwitch but I think its only for relocating within a svn repo (ie svn switch, not svn relocate)

Edit: Or we could both see this SO post :)

Community
  • 1
  • 1
gbjbaanb
  • 51,617
  • 12
  • 104
  • 148
1

I had this exact problem after I changed the name of my repository. I changed the .git/config SVN url as you did, and then ran git pull to update my repo to the latest version, merged the new files, and then was able to run git push with no issues.

What error did git give when it wouldn't let you push? Before I pulled and merged the latest version of the repo, mine said ! [rejected] master -> master (non-fast-forward), which basically is git's way of saying "Your version of the repo is too old... run git pull first..."

daviewales
  • 2,144
  • 21
  • 30
0

If only the domain name changed, you could simply edit your /etc/hosts file (or whatever the equivalent is over in Windows land) to let the old name point to the new address.

innaM
  • 47,505
  • 4
  • 67
  • 87
  • I tried it but for some reason its not working. And I cant seem to fix it. But I'd like to know how to fix this the poper way, using git, since the location might change aswell in the (near) future. –  Aug 16 '09 at 13:05