When trying to push
, I get a fatal error because git is trying to include a file that is too large for GitHub. git rm file
fails because the file doesn't exist (it has existed, but no longer does). Git seems to refuse to acknowledge that the file is gone.
What should I do?
For information, the error message I get is:
remote: error: GH001: Large files detected.
remote: error: Trace: dbbfb79f51f133c90dfd58730a4ab624
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File [filename] is 385.65 MB; this exceeds GitHub's file size limit of 100 MB
To https://github.com/[---].git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/[---].git'
If the above is as impossible to achieve as it seems, instructions on how to just torch all the git related stuff here and set it up from scratch with code that we have preserved in backup directories would be great. We really don't have time to mess around with git anymore...
The trick to prevent accidentally pushing in-development changes to the wrong environment is to use the git command for changing remote's URL. By adding the --push flag to the command, only the push URL is manipulated. So it is still possible to pull from that remote.
Use your favorite text editor to open the file called . git/info/exclude within the root of your Git repository. Any rule you add here will not be checked in, and will only ignore files for your local repository.
The upstream Git repository will be oblivious to your attempted push, and no change will occur upstream.
Run git rm --cached file
even if the file does not exist anymore. This way, the file will be removed from the index.
If you are looking to completely eradicating the file from Git history, you will need some git filter-branch
-fu instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With