完整備份 Remote Git Repository
先clone一份裸儲存庫,即一個不包含當前工作目錄的儲存庫
mkdir /Users/{Your_Name}/Documents/mirrorcd /Users/{Your_Name}/Documents/mirrorgit clone --bare username@10.34.70.118:Documents/repo.git
完成後在 mirror 目錄下會有一個 repo.git 的 folder
到該 folder 裡,再 push 到新的 empty repository 即完成。
cd repo.gitgit push --mirror username@10.34.70.120:Documents/newRepo.git
補充:如何建立 empty repository
到欲創建 Git repository 的目錄下,建一個 “xxx.git” 的資料夾
cd /Users/{Your_Name}/Documentsmkdir newRepo.gitcd newRepo.gitgit init --bare