Why all files tracked with git LFS are deleted in a cloned repo?

I have a repo that has been set up with Netlify large media. I cloned the repo to my local but it did not download the files tracked with git LFS at first.

After the setting up the Netlify Git’s credential helper with netlify lm:install and source /Users/shafiemukhre/Library/Preferences/netlify/helper/path.bash.inc,
netlify lm:info returned the following:

✔ Checking Git version [2.19.0]
✔ Checking Git LFS version [2.13.3]
✔ Checking Git LFS filters
✔ Checking Netlify's Git Credentials version [0.1.10]

Then I run git lfs fetch --all to download all the LFS files into my local. At first, the terminal showed this (which seems good):

fetch: 4589 object(s) found, done.
fetch: Fetching all references...
Downloading LFS objects:  85% (3886/4589), 745 MB | 4.1 MB/s

After the download was completed, I expected that I will be able to see the all the images tracked with git lfs. However, all the files are deleted, it looks like this in my terminal

deleted:    stories/the-winter-olympics/images/sports/Screen Shot 2018-03-05 at 5.26.39 PM.png
deleted:    stories/the-winter-olympics/images/sports/Short-Track Speedskating.png
deleted:    stories/the-winter-olympics/images/sports/Skeleton.png
deleted:    stories/the-winter-olympics/images/sports/Ski Jumping.png
deleted:    stories/the-winter-olympics/images/sports/Speedskating.png

Why and how to solve this? My teammate faced the same issue as well. I want my team to be able to use git LFS and NLM as well when they cloned the repo into their local, thank you.

Okay, I solved this.

The solution is to remove the folder and reclone it again. Somehow, in the first clone, all the files tracked with git LFS were deleted because I set up the Netlify Git’s credential helper with netlify lm:install after I cloned the repo. It seems I should set it up first before cloning a repo with git LFS and NLM configured.

1 Like

Thank you for coming back and sharing your solution with the Forums, @shafiemukhre :netliconfetti: This will benefit future Forums members who encounter a similar situation!