Re: git is live

Pedro Alves
2013-10-22T19:07:14Z

On 10/22/2013 07:41 PM, Cary Coutant wrote:
>> The URLs:
>>
>> git://sourceware.org/git/binutils-gdb.git
>> ssh://sourceware.org/git/binutils-gdb.git
>
> Thanks, Tom!
>
> Does anyone know if it's possible to switch my existing git repos
> (cloned from the old mirror at sourceware.org/git/binutils) to the new
> one? Or is it best to clone from scratch?

What I did was first was:

git add remote binutils-gdb ssh://sourceware.org/git/binutils-gdb.git

and then:

git fetch binutils-gdb

But, git appeared to hang, making no progress. It wouldn't even
start fetching. stracing git, it looked like git was checking
if the existing remotes and the new remote share ancestry/commits,
a commit/rountrip at a time. That'd take forever. So what I
did next was:

Created a fresh clone from scratch:

$ mkdir binutils-gdb
$ cd binutils-gdb
$ git clone ssh://sourceware.org/git/binutils-gdb.git src

Then I went back to my old git repo checkout, and added a
remote pointing to the new local checkout:

$ cd ../../my-old-git-repos-checkout-dir/src
$ git remote add binutils-gdb /local/path/to/fresh/binutils-gdb/src
$ git fetch binutils-gdb

Now the same "does the new remote share commits/ancentry"
process ended in seconds, because it was all local, and git
started fetching the new repo/remote in a matter of seconds.

So now I did:

$ git remote set-url binutils-gdb ssh://sourceware.org/git/binutils-gdb.git

to reset the remote url back to the real remote url, rather than
the temporary clone directory.

Voila. Then I did:

$ git fetch binutils-gdb

once more, and that worked as expected.

From there on, I've just been switching to by local
branches that were based on the old git mirror, and rebased
them on top of binutils-gdb/master.

I then renamed my "upstream" remote to "old-cvs-mirror",
and my "binutils-gdb" remote to "upstream". :-)

Dunno if there's an easier way, but that worked nicely
for me, and it only took a few minutes.

--
Pedro Alves