Team member added hundreds of megs to git

Possible Duplicate:
How can I remove a commit on github?

So a team member on our project has committed and pushed 700+ megs of nonsense to our git project repository... She thought she was adding only 2 images but instead somehow ended up copying the entire contents of her desktop to the git folder and somehow committing it. I don't know why she thought it wasn't weird that 2 pictures took 20 minutes to upload...

Anyways I'm in a predicament now as head of this project. I have 2 choices as far as I see it and I don't like either one

  • I could delete the repository from bitbucket and start it again with the files I want. This would remove all previous edits since only the current version of the files I want will be available

  • I could delete the erroneous data and push the changes. Only the files we want will be further managed but all the extra crud she put up there will forever exist in the git inflating our project 100 fold.

  • Is there any way to ACTUALLY remove a commit forever as if it never happened? What would be the best way to manage this hiccup other than more remedial git training...


    I would do

    $ git checkout master~1 -b newmaster
    $ git branch -D master
    $ git reflog expire --expire=now --all
    $ git gc --prune=now
    $ git checkout -b master
    $ git branch -D newmaster
    

    gc should do garbage collection. I think you can do this on the server.


    我不知道bitbucket是否允许,但你可以这样做:

    git reset HEAD~
    # Or the SHA of the version before the huge commit
    git push --force
    
    链接地址: http://www.djcxy.com/p/11670.html

    上一篇: 如何在使用gevent时在Python中获取POST变量?

    下一篇: 团队成员向git添加了数百个megs