[GIT]轉移整包git commit 至其他台主機

 

  1. 先將原git的mirror整包 clone 下來
    1
    git clone --mirror https://git.compilerok/oldJob.git
  2. 到 gitlab 建一個空的 repo

  3. 進到專案資料夾,設定新的遠端 git repo 位置

    1
    2
    cd oldJob.git/
    git remote set-url --push origin https://Newgit.compilerok/newJob.git
  4. local 更新 remote branch,因為是新的 repo,並將本地的 origin/xxx 都刪囉。-p == --prune
    1
    git fetch -p origin
  5. 最後將整包 push 上去
    1
    git push --mirror
  6. 可以在 Gitl上看到 repo 裡有先前的所有紀錄與內容囉。

留言

這個網誌中的熱門文章

[MS SQL]資料庫複寫 刪除發行集 無法刪除

net use 系統發生 1219 錯誤

[Windows]密碼複雜性需求 停用密碼複雜度