Question

I'm currently evaluating options for Git repository hosting services for my team. I'm partial to using GitHub, but there may be reasons that we would instead (or in addition) want to use Atlassian's Stash.

With Git is it possible to copy a repository and its history from hosting service to another? Are there any gotchas with doing this? If we go down one provider and decide we have to switch later then is there anything that we would lose?

I am interested in the general answer about this for Git, but also are there any likely issues with data (not necessarily just source version history) stored as part of that would be lost by trying to migrate specifically between the GitHub and Atlassian stacks?

Was it helpful?

Solution

Joe, per your comment, the question doesn't make much sense in the context of git. Any clone of your repository contains the entire history of the repository. That written, there are three things you'd need to recreate if you changed services:

  1. Any git hooks setup on github. These aren't stored with the repository (for any cloned repository). However, there's no reason you couldn't version control them, too, so recreating them on any service would be easy. This is also a good practice. Version control anything you care about.

  2. Users permissioned to access the repository. Obviously, any service change means your developers would have to get accounts on that service, get permissioned to view the company repository, etc.

  3. Personal developer repositories. Forks of your company repo will obviously need to be recreated on the new service, but this is a trivial operation once you've done -2- and kept -1- in mind. You could do it as easily as David describes in his answer.

OTHER TIPS

I just tested this with two different remotes and by adding the new, removing the old, and pushing, the commit history was not lost.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top