Create snapshots of certain folders from remote master

Viewed 39

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.

1 Answers

I would try at least a git lfs fetch --all after your shallow fetch, in order to make sure you have all the LFS objects resolved.

If the error persists, try a full LFS clone, take what you need from the result, and delete the clone.

Related