You can:
- git clone <your github repo> - git reset --hard <an_older_commit> (where you didn't have those huge files) - git push --force origin master
In this way:
- Your original local repo is not affected (and you can fix it so you don't click these files again)
- Your remote repeater (GitHub) no longer sees those who make transactions with huge files in it.
- GitHub will periodically run
git gc on its side, completely clearing files without links.
However, OP Martin mentions:
how can i do a reset --hard in position before the first commit?
those. I would like to get repo empty and not rollback to previous commit
In this case, create a new local repo, make the first small commit and push --force , which will commit.
More generally, I always try to have the first small initial commit on the main branch when creating a repo, in order to be able to return to the minimum commit or start a new branch (for unrelated development efforts) from the specified minimum commit.
source share