前言
最近公司因項(xiàng)目拆分,要將原有代碼移植到新的 Git 項(xiàng)目組。剛開始是想把代碼直接拷貝過(guò)去,但提交的歷史信息和原有分支就會(huì)丟失。于是網(wǎng)上找了下方法具體操作了一次可行,這里就記錄一下。
git clone --mirror https://github.com/xxxxxxx/oldProject.git
cd oldProject.git
git remote set-url –-push origin https://github.com/xxxxxxx/newProject.git
git push –-mirror
總結(jié)
簡(jiǎn)單的幾個(gè)命令就搞定,Git 很強(qiáng)。