Sadly none of the above worked for me so I spent very long time trying different combination of sparse-checkout
file.
In my case I wanted to skip folders with IntelliJ IDEA configs.
Here is what I did:
Run git clone https://github.com/myaccount/myrepo.git --no-checkout
Run git config core.sparsecheckout true
Created .gitinfosparse-checkout
with following content
!.idea/*
!.idea_modules/*
/*
Run 'git checkout --' to get all files.
Critical thing to make it work was to add /*
after folder's name.
I have git 1.9
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…