Skip to content

Instantly share code, notes, and snippets.

@haijerome
Created March 7, 2014 05:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haijerome/9405598 to your computer and use it in GitHub Desktop.
Save haijerome/9405598 to your computer and use it in GitHub Desktop.
someuser@somedomain [~/public_html/dev]# git rm var/log/system.log fatal: pathspec 'var/log/system.log' did not match any files
someuser@somedomain [~/public_html/dev]# git commit -m "Delete system.log file "
# On branch master
# Your branch is ahead of 'origin/master' by 6 commits.
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# error_log
# products_update_2014-03-06.csv
nothing added to commit but untracked files present (use "git add" to track)
someuser@somedomain [~/public_html/dev]# git push -u origin master
Counting objects: 1341, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1143/1143), done.
Writing objects: 100% (1330/1330), 7.70 MiB | 1.62 MiB/s, done.
Total 1330 (delta 692), reused 0 (delta 0)
remote: warning: File var/log/system.log is 57.82 MB; this is larger than GitHub 's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: 065adf54bb45f5bf120304976a8517f8
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File var/report/752246136671 is 100.86 MB; this exceeds GitHub's file size limit of 100 MB
To git@github.com:someuser/some-repo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:someuser/some-repo.git'
@kopano-ProgrammerMan
Copy link

Try this , http://stackoverflow.com/questions/9240949/how-to-remove-a-file-permanently-in-git-without-getting-warning-ref-refs-head

git filter-branch --index-filter 'git rm --cached --ignore-unmatch file/Directory/name.sql'

@MareoRaft
Copy link

THANK YOU.

git filter-branch worked for me, too.

@csjunxu
Copy link

csjunxu commented Jul 28, 2018

Thank you, it works 👍

git filter-branch --index-filter 'git rm --cached --ignore-unmatch file/Directory/name.sql'

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