我有我的Git存儲庫,它在根目錄下有兩個子目錄:/finisht/static當這是在SVN,/finisht在一個地方/static檢查,而在其他地方檢查,如下:svn co svn+ssh://[email protected]/home/admin/repos/finisht/static static有沒有辦法用Git做到這一點?
4 回答

蕪湖不蕪
TA貢獻1796條經驗 獲得超7個贊
您可以組合稀疏結帳和淺克隆功能。在淺克隆切斷歷史和稀疏結帳只翻出符合模式的文件。
git init <repo>cd <repo>git remote add origin <url>git config core.sparsecheckout trueecho "finisht/*" >> .git/info/sparse-checkoutgit pull --depth=1 origin master
你需要最低限度的git 1.9來實現這個目的。僅使用2.2.0和2.2.2對自己進行了測試。
這樣你仍然可以推動,這是不可能的git archive
。
- 4 回答
- 0 關注
- 2061 瀏覽
添加回答
舉報
0/150
提交
取消