Here is a working solution to this. The solution has the following features:
- It does not checkout the WHOLE repo, it just checks out what you need (this comes in very handy if you have repos of 100GB and more)
- You create a new repo as target, so nothing gets changed in your original repo, nice ey?
Solution
git init /example/gittest
cd /example/gittest
git remote add -f origin /PATH/TO/SOURCE/REPO/.git
git config core.sparsecheckout true
echo images >> .git/info/sparse-checkout
git pull origin master
Now it copies only the images
folder from your original repo to this test repo. Then you can do with the data what you want.