[How To] Completely remove a file from all Git commits

Fixing git merge conflicts

//remove file from across the repo
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch /path/to/file' --prune-empty --tag-name-filter cat -- --all
 
//push changes
git push origin --force --all
 
//optional: update tags 
git push origin --force --tags
 

 

Source:

https://help.github.com/articles/removing-sensitive-data-from-a-repository/

 

 

Attached Files
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Name
Email
Security Code Security Code
Related Articles RSS Feed
[How To] Rename a local and remote branch in git
Viewed 1515 times since Mon, Mar 6, 2017
MENU