Tech Chorus

Migrating Git Repository To A New Server

written by Sudheeer Satyanarayana on 2021-11-03

Make a temporary directory.

mkdir my/temp/directory/for/migration

Clone from the old location.

git clone --bare git@example.com/some/path.git

Change directory to newly created clone.

cd newlycreatedclonedrepodirectory

Push to new location

git push --mirror git@example.net/some/path.git
Tags: git shell bash migration