差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
tech:gitlab-to-github [2021/02/03 16:02] jonathantech:gitlab-to-github [2021/02/04 11:42] (目前版本) jonathan
行 13: 行 13:
   * 之後在 GitLab 上的 push 就可在 GitHub 上看到 {{:tech:20210203_03.png|}}   * 之後在 GitLab 上的 push 就可在 GitHub 上看到 {{:tech:20210203_03.png|}}
  
 +==== Q1. 原本 GitHub 已有資料 ====
 +  - 先將 GitHub 的專案 clone 到本地的工作目錄內
 +  - 修改這目錄內的 .git/config 內的 URL 由原本的 GitHub 網址改為 GitLab 網址, Exp. <file>
 +[core]
 + repositoryformatversion = 0
 + filemode = false
 + bare = false
 + logallrefupdates = true
 + symlinks = false
 + ignorecase = true
 +[remote "origin"]
 + url = http://gitlab-demo.iiidevops.org/root/php-app-pipeline-template.git
 + fetch = +refs/heads/*:refs/remotes/origin/*
 +[branch "master"]
 + remote = origin
 + merge = refs/heads/master
 +</file>
 +  - 再執行一次 push 到 GitLab 就會兩邊一致, 此時進行同步才會正確 
  
  
  • tech/gitlab-to-github.1612339336.txt.gz
  • 上一次變更: 2021/02/03 16:02
  • jonathan