Skip to content

Instantly share code, notes, and snippets.

@vlobachev
Forked from AgiosAndreas/repo-full-copy.sh
Created February 18, 2022 11:38
Show Gist options
  • Select an option

  • Save vlobachev/e4ba89084d41c7301bedcfe500808645 to your computer and use it in GitHub Desktop.

Select an option

Save vlobachev/e4ba89084d41c7301bedcfe500808645 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