So here's what's happened:
- Accidentally committed lots of files that weren't meant to be.
- Did a
git reset --soft HEAD~2
to get back to a commit before the accident - Modified gitignore to ignore the files
- Commited again and pushed to origin.
I assumed the git reset would revers everything from the accidental commit, but after checking bitbucket's list of git lfs files, it seems all the lfs tracked files from the accidental commit were pushed to lfs in origin. These files do not exist if I look through the source in bitbucket.
So I tried doing git lfs prune
which appeared to delete an amount of files that looks to be about the amount that was accidentally commited, then git lfs push origin master
. Checked bitbucket's list of git lfs files again, but those files are still there and nothing's changed in origin.
What have I done wrong?
There doesn't appear to be a standard way of doing this:
Bitbucket allows you to delete LFS files using its web UI (please read the entire linked page before proceeding):
Surprisingly, the only way to remove LFS files from GitHub appears to be to delete and recreate the repository, losing issues, stars, forks, and possibly other data.