-
Notifications
You must be signed in to change notification settings - Fork 0
Repository Migration
Here's one way to migrate from an existing git repository into GitHub.
-
Create a New GitHub repository
-
Leave this repository empty for now.
https://github.com/The-Vanderbilt-University/vuit-rep-creation-iac
-
-
Create a fresh clone of your old repository
$ git clone --mirror <OLD PROJECT REPO >.git -
Change the remote to your new repo
$ cd OLD_PROJECT_REPO_DIR $ git remote set-url origin <NEW PROJECT REPO>.git -
Push to GitHub
$ git push --mirror origin -
Default Branch
Make sure your default branch is configured as you expect. By, default, GitHub repositories are created with
mainas the default branch. If your project has no branch namedmain, you'll need to go into the repository settings and update your default branch.- Update master to main locally
git branch -m master main git fetch origin git branch -u origin/main main git remote set-head origin -a
- Update master to main locally
The above migration process will include all branches and tags.
Once the above steps are complete, your repository will exist in both places. You'll probably want to delete or archive your old repository to avoid confusion.