Skip to main content
after this command you cant push - but there is a way to fix
Source Link

This is the only option that worked for me.

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.sql' 

Note: Replace *.sql with your file name or file type. Be very careful because this will go through every commit and rip this file type out.

EDIT: pay attention - after this command you will not be able to push or pull - you will see the reject of 'unrelated history' you can use 'git push --force -u origin master' to push or pull

This is the only option that worked for me.

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.sql' 

Note: Replace *.sql with your file name or file type. Be very careful because this will go through every commit and rip this file type out.

This is the only option that worked for me.

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.sql' 

Note: Replace *.sql with your file name or file type. Be very careful because this will go through every commit and rip this file type out.

EDIT: pay attention - after this command you will not be able to push or pull - you will see the reject of 'unrelated history' you can use 'git push --force -u origin master' to push or pull

added 13 characters in body
Source Link
Jason Glisson
  • 1.2k
  • 7
  • 10

This is the only option that worked for me.

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.sql' 

Note: Replace *.sql with your file name or file type. Be very careful because this will go through every commit and rip this file type out.

This is the only option that worked for me.

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.sql' 

Note: Replace *.sql with your file type. Be very careful because this will go through every commit and rip this file type out.

This is the only option that worked for me.

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.sql' 

Note: Replace *.sql with your file name or file type. Be very careful because this will go through every commit and rip this file type out.

Source Link
Jason Glisson
  • 1.2k
  • 7
  • 10

This is the only option that worked for me.

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.sql' 

Note: Replace *.sql with your file type. Be very careful because this will go through every commit and rip this file type out.