Follow the steps below to move a full Git repository, with history, from one remote server to another. You can move an entire repository or allow choose which branches and tags to include.
For the sake of this tutorial, the original repository will be
https://github.rcac.purdue.edu/foo/bar
and it will be moving to
https://github.itap.purdue.edu/foo/bar
.
1)
Create an empty repo on the new Git server:
You need to have an empty target repository to push your cloned repository to. Do not add any of the suggested
README
or
LICENSE
auto-generated files as they will not be needed.
You will see this
refs/pull
errors if your repository has ever had a
Pull Request
.
refs/pull
is a private, read-only ref created by GitHub, in part, to allow for linking back to a Pull Request and its discussion thread, etc. These references cannot be mirrored but
they do not prevent mirroring the rest of the repo and its history.
These errors can be safely ignored.
There should now be a full copy of the repository at
https://github.itap.purdue.edu/foo/bar
.
It's a good idea to archive the old repository at
https://github.rcac.purdue.edu/foo/bar
to avoid having other users making commits to the old repository. See below for more information on how to archive a repository on GitHub.
You can also migrate GitHub wikis using the above procedure because wikis are simply Git repositories that follow the special naming convention
[repo-name].wiki.git
. As with repositories, an empty wiki at the destination (e.g.,
https://github.itap.purdue.edu/[owner]/[repo-name]/wiki
) must first be created before you try pushing to it.
Archiving a repository lets users know that the repository is no longer used. When archiving a repository, all of its issues, pull requests, code, labels, milestones, projects, wiki, releases, commits, tags, branches, reactions, and comments become read-only. To make any changes to an archived repository it must be unarchived first.
To archive a repository, navigate to the main page of the repository and click the
Settings
tab for the repository. Scroll down and find the
Danger Zone
where you should click the
Archive this repository
button. Read the warnings and type the name of the repository
foo/bar
in the confirmation box and click the button to archive the repository.
To unarchive a repository, follow the same instructions as archiving the repository, all the buttons will be replaced with ones to unarchive the repository.
For more information about archiving repositories you can visit
GitHub's documentation
and click the button to archive the repository.
Please don't include any personal information in your comment. Maximum character limit is 250.
Characters left:
Purdue University, 610 Purdue Mall, West Lafayette, IN 47907, (765) 494-4600