DEV Community

Discussion on: How to delete a file permanently in git

Collapse
 
awwsmm profile image
Andrew (he/him)

Tell your collaborators to rebase:

$ git rebase

...this is the critical bit. If anyone still has the "bad" file and pushes to the remote repo again, it will be added back to the commit history. This is why you should always triple check what you're pushing to publicly-accessible repos. Anyone who's ever cloned it will have all the files you ever added, even ones you delete in this way.