The official USGS Git hosting platforms available include the following (see comparison):

Step-by-step guides

  1. Log in to Bitbucket and navigate to the repository that you are moving

  2. Make note of the SSH/HTTPS clone URL for the existing repository (ex. ssh://git@my.usgs.gov/project/old-repo.git)

  3. Log in to the new hosting platform where you are migrating the repository to

  4. Create a new empty repository/project

  5. Make note of the SSH/HTTPS clone URL for the new repository (ex. git@code.usgs.gov:group/new-repo.git)

  6. Run the following Git commands:
       git clone --mirror ssh://git@my.usgs.gov/project/old-repo.git
    cd old-repo.git
    git push --mirror git@code.usgs.gov:group/new-repo.git

  7. The new repository should now contain all branches from the old repository (Note: pull requests and discussions will not be preserved). Please verify that everything was copied correctly, then remove the old repository/project from Bitbucket

  8. If you have any existing repositories cloned to your workstation, you will need to update the Git remote URL using the following commands:
       cd existing_repo
    git remote rename origin old-origin
    git remote add origin git@code.usgs.gov:group/new-repo.git

Additional Resources