Best way to switch tfs-remote

683 views
Skip to first unread message

andrew....@gmail.com

unread,
May 7, 2012, 9:15:47 AM5/7/12
to git-t...@googlegroups.com
My team is in the middle of a migration from one tfs server to another. I've been using git-tfs in my development workflow, but no one else on the team is. I'd like to keep the same git repository, and simply switch the tfs remote I'm committing to so that I'm pointing to the new server. I'm about 90% sure that on our new server we're just going to start with a blank tfs repository and not bother migrating over any of the commit history.

Do you guys have any suggestion on how to handle this migration on my end. Right now the only thing I feel positive would work would be creating a new git repository locally, cloning the empty folder on the new tfs server with git-tfs, and then copying all of my work into the new repo. But I'd rather keep the existing git repo if at all possible.

Ivan Danilov

unread,
May 7, 2012, 9:22:17 AM5/7/12
to git-tfs-dev
You could clone your repository and init new tfs-remote there (without
issuing git tfs bootstrap). After that, fetch first revision from new
tfs-remote and use grafts point to link corresponding git commit to
last commit of your old history. Then rebase to bake grafts into the
real git history. I believe it could solve your issue without much
problems.

There're exist more efficient ways, e.g. tampering with plumbing
commands and 'git-tfs-id'-s, but it would be more complicated.

Matt Burke

unread,
May 7, 2012, 11:22:00 PM5/7/12
to git-t...@googlegroups.com
I'm not sure how seamless of a transition you're looking for... If you
just want to get all three in the same repo, that's definitely doable,
though there may need to be some under-the-covers tinkering to make it
all work right.

First, just to add another tfs remote should be pretty
straightforward. From your git repo, `git tfs init -i new_tfs
http://new-tfs.your.com/tfs/DefaultCollection $/blah/blah`. That
should add a new tfs remote that you can fetch with `git tfs fetch -i
new_tfs`. The new branch will be tfs/new_tfs.

At this point, you should be able to use git to cherry-pick, etc, to
transfer your work from one branch to another.

Is that where you're trying to get?

--
Matt
> --
> You received this message because you are subscribed to the Google Groups
> "git-tfs-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/git-tfs-dev/-/qpUmaSWwv_EJ.
> To post to this group, send email to git-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> git-tfs-dev...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/git-tfs-dev?hl=en.

andrew....@gmail.com

unread,
May 8, 2012, 4:14:02 PM5/8/12
to git-t...@googlegroups.com
Matt,

That's exactly what I was looking for. I didn't realize I could have mulitple tfs repos as essentially different branches.


On Monday, May 7, 2012 11:22:00 PM UTC-4, matt wrote:
I'm not sure how seamless of a transition you're looking for... If you
just want to get all three in the same repo, that's definitely doable,
though there may need to be some under-the-covers tinkering to make it
all work right.

First, just to add another tfs remote should be pretty
straightforward. From your git repo, `git tfs init -i new_tfs
http://new-tfs.your.com/tfs/DefaultCollection $/blah/blah`. That
should add a new tfs remote that you can fetch with `git tfs fetch -i
new_tfs`. The new branch will be tfs/new_tfs.

At this point, you should be able to use git to cherry-pick, etc, to
transfer your work from one branch to another.

Is that where you're trying to get?

--
Matt

On Mon, May 7, 2012 at 9:15 AM,  wrote:
> My team is in the middle of a migration from one tfs server to another. I've
> been using git-tfs in my development workflow, but no one else on the team
> is. I'd like to keep the same git repository, and simply switch the tfs
> remote I'm committing to so that I'm pointing to the new server. I'm about
> 90% sure that on our new server we're just going to start with a blank tfs
> repository and not bother migrating over any of the commit history.
>
> Do you guys have any suggestion on how to handle this migration on my end.
> Right now the only thing I feel positive would work would be creating a new
> git repository locally, cloning the empty folder on the new tfs server with
> git-tfs, and then copying all of my work into the new repo. But I'd rather
> keep the existing git repo if at all possible.
>
> --
> You received this message because you are subscribed to the Google Groups
> "git-tfs-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/git-tfs-dev/-/qpUmaSWwv_EJ.
> To post to this group, send email to git-t...@googlegroups.com.
> To unsubscribe from this group, send email to
Reply all
Reply to author
Forward
0 new messages