问题
I had quite some problems after pushing large files in the git reposotory.
I tried different things messing up everything.
The last command I tried was
git filter-branch --tree-filter -f 'rm -rf FOLDERWITHLARGEFILES/*' HEAD
and it I thought I solved the problem because the following
git push origin master
worked.
The problem is that now I have a very old version of my rep. I think that is the version before I tried to commit the large files. Is there a way to recover the repository.
To recap:
I tried to push large files. I continued working on my files I tried to solve the problem of pushing large files...
Thanks a lot in advance
Here the history of what I did:
1) I pushed the last time on May the 9th
2) I modified locally the code
3) I tried to push large files so git didn't allow me
4) I did some mess trying to cancel the commits like:
$ git filter-branch -f --tree-filter 'rm -rf FOLDERWITHLARGEFILES/*' HEAD
$ git filter-branch --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch DATA/*' --tag-name-filter cat -- --all
$ git commit --amend -CHEAD
$ git rm --cached FOLDERWITHLARGEFILES/
$ git update-index --assume-unchanged FOLDERWITHLARGEFILES/
5) I pushed again today and I found both locally and in the rep the code at the last correct push (point 1)
来源:https://stackoverflow.com/questions/23627522/recover-git-repository-to-old-version