Backup and Restore Git Repositories

Sometimes you need to move repositories from your local git server to, or vice versa. the situation where you want to archive the whole "bare" repo, not just a clone with the master or a single branch.

Backup can be done simply by adding --bare to the clone command

git clone --bare

This will result in a cloned repo on the filesystem that is similar in structure to a bare repository

Restoring can be done by creating an empty repository on your git server ( or and running

cd test-repo.git
git push --mirror



Unknown said…
HOw to do a clone repository in local linux server

Popular posts from this blog

Prime Numbers Generator

has_and_belongs_to_many & Duplicate entry Error

Exporting data from remote mysql instance in csv, using mysql client and sed