Skip to content

Instantly share code, notes, and snippets.

@zveronline
Forked from AgiosAndreas/repo-full-copy.sh
Created December 27, 2016 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zveronline/48e871e6390f44f47b5677a005e8275b to your computer and use it in GitHub Desktop.
Save zveronline/48e871e6390f44f47b5677a005e8275b to your computer and use it in GitHub Desktop.
Полный перенос git репозитория на другой сервер
# Клонируем исходный репозиторий без рабочего каталога (--bare)
git clone --bare https://github.com/exampleuser/old-repository.git
cd old-repository.git
# Делаем mirror-push(будут скопированы все ветки и тэги) в новый репозиторий
git push --mirror https://github.com/exampleuser/new-repository.git
cd ..
# Удаляем папку с репозиторием
rm -rf old-repository.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment