Removing file from all history.
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch PATH-TO-FILE" \
--prune-empty --tag-name-filter cat -- --all"
Note: If this file exits at other locations in history then you need to run the above command for those paths as well.
Add your file to .gitignore to ensure that you don't add it accidentally.
echo "PATH-TO-FILE" >> .gitignore
git add .gitignore
Git Converting CRLF to LF on Windows/Mac
Create .gitattributes under repo. Contents of file
* text=CRLF
After adding this file run below command in repo to update existing files
git add --renormalize .
Commentaires