Git -clone遠程倉庫的某一個分支

如今有一個test倉庫https://github.com/huanglaifeng/seriesOfC- 你要gitclone裏面的"C++中構造函數的初始化列表"子目錄: 在本地的硬盤位置打開Git Bashgit

git init test && cd test     //新建倉庫並進入文件夾
git config core.sparsecheckout true //設置容許克隆子目錄

echo 'C++中構造函數的初始化列表' >> .git/info/sparse-checkout //設置要克隆的倉庫的子目錄路徑   //空格別漏

git remote add origin https://github.com/huanglaifeng/seriesOfC-.git  //這裏換成你要克隆的項目和庫

git pull origin master    //下載
複製代碼
相關文章
相關標籤/搜索