Answer the question
In order to leave comments, you need to log in
A large >100 mb file got into Git commit how to delete?
Git commit got a file> 100 mb how to delete?
I need to remove it from a commit, but there were more commits after that commit!
Commits must remain, but files must either be uploaded or deleted
050d105 [email protected]{10}: reset: moving to HEAD 050d105 HEAD
@{11}: Branch: renamed refs/heads/master-2 to refs/heads/master {14}: Branch: renamed refs/heads/master to refs/heads/master-2 050d105 [email protected]{16}: Branch: renamed refs/heads/master-2 to refs/heads/master 050d105 [email protected]{18}: Branch: renamed refs/heads/master to refs/heads/master-2 050d105 [email protected]{20}: Branch: renamed refs/heads/master to refs/heads/master 050d105 [email protected]{22}: reset: moving to HEAD~ 1 fcf55bd [email protected]{23}: commit: add view/options 050d105 [email protected]{24}: Branch: renamed refs/heads/master to refs/heads/master
Answer the question
In order to leave comments, you need to log in
I will answer a little more than you ask:
A specific file (www/video/route.mp4):
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch www/video/route.mp4 ' --prune-empty --tag-name-filter cat -- --all
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch "*.mp4" ' --prune-empty --tag-name-filter cat -- --all
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch www/video -r' --prune-empty --tag-name-filter cat -- --all
git push origin --force --all
git reset --hard origin/...
Removing the passwords.txt file from all commits
git filter-branch --tree-filter 'rm -f passwords.txt' HEAD
git fetch && git checkout master && git reset --hard origin/master
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question