如何使用子模塊獲取非裸Git回購並使其適合安裝在服務器上? (裸)以下工作的Git:我如何在服務器上添加子模塊的非裸回購?
無:
git clone --bare nonBare bare
git clone --bare --recursive nonBare bare
git clone --recursive nonBare bare; cd bare; git config --bool core.bare true
該服務器是GIT-守護進程。
如何使用子模塊獲取非裸Git回購並使其適合安裝在服務器上? (裸)以下工作的Git:我如何在服務器上添加子模塊的非裸回購?
無:
git clone --bare nonBare bare
git clone --bare --recursive nonBare bare
git clone --recursive nonBare bare; cd bare; git config --bool core.bare true
該服務器是GIT-守護進程。
在服務器創建一個裸回購
mkdir bareRepo.git
cd bareRepo.git
git init --bare
在源非裸露回購
git push --mirror <bareRepo.git URL>
在原來,有多個問題。鑑於git-daemon服務器不支持與我有的repo相同的子模塊表示,我決定將每個子模塊作爲單獨的repo對待。我不得不處理的一個問題是,由於現有的回購有一個我無法訪問的服務器的遠程服務器,因此我必須爲新服務器創建新的遠程服務器。當進行git推送時,只推送當前分支,而不是所有(舊)遠程跟蹤分支。
要遷移,我寫了一個腳本,做了以下內容:
for every submodule, created a destination directory and did a "git init --bare" in it
for every submodule
for every branch in the submodule, do a "git checkout <branch>"
do a "git push --mirror <destination Directory>
謝謝,但似乎並沒有拿起子模塊。我正在使用git 1.7.4.1版。 –
注意:用於創建原始回購站的git版本較新,因此存在帶有「gitdir:...」內容的.git文件。 –