search

Home  >  Q&A  >  body text

When I use git to push code to oschina, it keeps prompting that one of the log files is too large, but I have already deleted that log file?

1. I committed a .log file (about 140M) in the project before, and when I pushed it to git.oschina, I was prompted that the file was too large and could not be pushed. Then I used the 'delete' key on the computer keyboard to delete it. file, commit here and then push, still the same error is reported

给我你的怀抱给我你的怀抱2827 days ago781

reply all(3)I'll reply

  • 为情所困

    为情所困2017-05-02 09:31:14

    Simply adding a new onecommit或者commit --amend only deletes this file from the current version. The entire process of adding this file and deleting this file is still recorded in the historical submission.
    If you want to completely remove this file from the repository, you must rewrite all commits in the history where this file exists.

    To rewrite history, you can use git filter-branch. For details, see the tutorial on Github. git filter-branch,具体可以看Github上的教程。
    当然对于简单的情况,你也可以选择git resetgit rebaseOf course, for simple situations, you can also choose git reset plus git rebase.

    Supplement:git rm file.log相当于rm file.log && git add file.log, the questioner has deleted the file and submitted it. If you don’t understand, please don’t answer randomly, okay...

    reply
    0
  • 为情所困

    为情所困2017-05-02 09:31:14

    Use git rm to delete

    reply
    0
  • 怪我咯

    怪我咯2017-05-02 09:31:14

    git rm --cached <filename> 

    Then perform add commit and other operations again
    You can ignore the .log file in the .gitignore file
    Otherwise it would be too troublesome to delete it every time it is generated

    reply
    0
  • Cancelreply