Skip to content

Instantly share code, notes, and snippets.

@Gravifer
Last active August 28, 2020 01:34
Show Gist options
  • Save Gravifer/ab40f98b157b19d12ffc0e72f4ec846d to your computer and use it in GitHub Desktop.
Save Gravifer/ab40f98b157b19d12ffc0e72f4ec846d to your computer and use it in GitHub Desktop.
Personal git-GitHub troubleshooting recipes (for rookies like me)

Personal git-GitHub troubleshooting recipes

Push to GitHub failed by phantom large files

This occurs when I have made mistaken commits and then tried to push in a latter commit when those large files no more exist; in this case merely clean up the cache doesn't work and requires more labor. I found a better approach at this post from StackOverflow
So the remedy is

git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD

And you should be good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment