Move Git Repository to New Git Server

Categories: git   migration

Move Git Repository to New Git Server

  • checkout repo local from old git server
  • create new repo on new server - no INIT!
  • rename origin on local chechout:

    git remote rename origin old-origin
    
  • add new origin to local

      git remote add origin ssh://git@192.168.2.230:30001/engels/cut3d.git
    
  • push local date to new git server

      git push -u origin --all
    
  • add all tags

      git push -u origin --tags
    

Rename branch:

https://www.w3docs.com/snippets/git/how-to-rename-git-local-and-remote-branches.html

Log

C:\src\3dCut>cd 3dcut

C:\src\3dCut\3dcut>git remote rename origin old-origin

C:\src\3dCut\3dcut>git remote add origin ssh://git@192.168.2.230:30001/engels/cut3d.git

C:\src\3dCut\3dcut>git push -u origin --all
key_load_public: invalid format
The authenticity of host '[192.168.2.230]:30001 ([192.168.2.230]:30001)' can't be established.
ECDSA key fingerprint is SHA256:y9H6IEhjrrazM6EBvLxzlKrQOzOyRB06g7JLxxGlNz4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.2.230]:30001' (ECDSA) to the list of known hosts.
Counting objects: 27119, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (9588/9588), done.
Writing objects: 100% (27119/27119), 398.00 MiB | 7.63 MiB/s, done.
Total 27119 (delta 13942), reused 21850 (delta 10816)
remote: Resolving deltas: 100% (13942/13942), done.
remote:
remote: To create a merge request for BranchV0.1.2, visit:
remote:   http://localhost:30000/engels/cut3d/-/merge_requests/new?merge_request%5Bsource_branch%5D=BranchV0.1.2
remote:
To ssh://192.168.2.230:30001/engels/cut3d.git
* [new branch]        BranchV0.1.2 -> BranchV0.1.2
* [new branch]        master -> master
Branch 'BranchV0.1.2' set up to track remote branch 'BranchV0.1.2' from 'origin'.
Branch 'master' set up to track remote branch 'master' from 'origin'.

C:\src\3dCut\3dcut>git push -u origin --tags
key_load_public: invalid format
Total 0 (delta 0), reused 0 (delta 0)
To ssh://192.168.2.230:30001/engels/cut3d.git
* [new tag]           AbgebeV.0.3.3 -> AbgebeV.0.3.3
* [new tag]           V.0.3.3RC -> V.0.3.3RC
Written on August 18, 2021