From 1e70a15b12d71d82a7701c4306203c1129da135d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 27 Jan 2026 19:20:57 -0500 Subject: [PATCH] Added information about how to move to a new repo, after moving to a new repo! --- Move to a new git repo.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Move to a new git repo.md diff --git a/Move to a new git repo.md b/Move to a new git repo.md new file mode 100644 index 0000000..63e154c --- /dev/null +++ b/Move to a new git repo.md @@ -0,0 +1,34 @@ +# How to migrate GIT repository from one server to a new one + +Taken from: https://stackoverflow.com/questions/1484648/how-to-migrate-git-repository-from-one-server-to-a-new-one + +## Steps to take on new Git Repo + +1. Create a new repository +2. Copy the link for step 3 below + +## Steps to take from a git-capable command line + +1. git clone --mirror +2. cd +3. git remote set-url origin +4. git push --mirror origin + +## After + +At this point, you have an old repo, a new repo, and a mirror on your filesystem. You can delete the .git folder and do a ```git clone``` of the new repo. + +## Examples + +Old repo: https://git.bitnetix.com/Bitnetix/documentation +New repo: http://git.bitnetix.local/eloyd/Documentation + +``` +git clone --mirror https://git.bitnetix.com/Bitnetix/documentation +cd documentation.git +git remote set-url origin http://git.bitnetix.local/eloyd/Documentation.git +git push --mirror origin +rm -Rf documentation.git +git clone http://git.bitnetix.local/eloyd/Documentation +cd Documentation +```