我有這樣的目錄結構:Git的稀疏結賬簡單的Web部署
../dir1/dev/project1/...
/project2/...
/project3/...
/production/
我有DEV(及其所有子目錄)簽入的Git(和github上)。一切正常。
我想使用github通過檢出(或拉,或其他)到我的生產目錄中來部署project2。 (具體而言,我想看看標籤。)所以這將導致../dir1/production/project2
我不是一個混帳專家,但已經在網上閱讀了一堆,似乎'稀疏結帳'就是我後。我試過here和here 和here的說明的各種組合。
基本上我做的事:
mkdir <repo> && cd <repo>
git init
git remote add –f <name> <url>
git config core.sparsecheckout true
echo /project2/ >> .git/info/sparse-checkout
當我做git pull <remote> TAGNAME
我得到fatal: The remote end hung up unexpectedly
。
當我做git checkout TAGNAME
我得到error: Sparse checkout leaves no entry on working directory
。
我在做什麼錯?