I want to create a copy of certain folders (FOLDER1/SUBFOLDER1, FOLDER2) from a remote master branch. I'm not interested in any historical data, other branches, I don't want to modify, or push back this data later. This is my current approach which has been working so far, but lately is failing with a git lfs "[404] Object does not exist on the server"
mkdir -p $(LOCAL_FOLDER)
cd $(LOCAL_FOLDER)
git init
git config core.sparseCheckout true
git remote add origin git@$(REMOTE_REPO):$(GITFILE).git
echo "FOLDER1/SUBFOLDER1\nFOLDER2" > .git/info/sparse-checkout
git fetch --depth 1 origin master
git checkout -f master
Standard git/linux commands should be preferred.