Skip to content

Instantly share code, notes, and snippets.

@avkosme
Created March 13, 2019 11:37
Show Gist options
  • Save avkosme/7f9db16d34db2ba7354705309a78dbb4 to your computer and use it in GitHub Desktop.
Save avkosme/7f9db16d34db2ba7354705309a78dbb4 to your computer and use it in GitHub Desktop.
$ git rm --cached giant_file
# Stage our giant file for removal, but leave it on disk
Commit this change using --amend -CHEAD:
$ git commit --amend -CHEAD
# Amend the previous commit with your change
# Simply making a new commit won't work, as you need
# to remove the file from the unpushed history as well
Push your commits to GitHub:
$ git push
# Push our rewritten, smaller commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment