Git Repo Migrator is a Python tool designed to simplify the process of migrating existing, locally saved git repositories from one server to another. It eliminates the hassle of manually removing old remote repositories and adding new ones by automating the entire process.
I originally hosted my self-managed git repositories on Gitea but decided to migrate to Soft Serve for its intuitive terminal user interface (TUI). Moving my repositories manually was tedious and error-prone, so I developed this program to streamline the migration process. This project was not only practical but also a fun way to practice my Python skills.
- Automatically removes the existing remote repository.
- Adds a new remote repository to your locally saved git repositories.
- Assumes:
- The current remote is named
origin
. - The default branch is
main
.
- The current remote is named
- Python 3.12.7
- Git installed and available in your system's PATH.
- Your repositories must already exist locally, preferably in a single directory.
- Clone the repository:
git clone https://github.com/xjwllmsx/git-repo-migrator.git
cd git-repo-migrator
- Make sure your existing repositories are locally stored.
- Run the program:
python git-repo-migrator.py
- Follow the prompts to complete the migration.
- Assumes the remote repository name is
origin
and the main branch ismain
. - Only supports repositories already cloned locally.
- Does not validate authentication for the new server (make sure your SSH keys or credentials are set up beforehand).
Contributions are welcome! Feel free to submit issues or pull requests on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.
Thanks to the Soft Serve team for creating a fantastic TUI-based git server.