top of page
Search
Writer's pictureKiazsoft

Git

Updated: Feb 26, 2023

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 .

5 views0 comments

Recent Posts

See All

Mac Useful Commands

Show hidden files in Finder Command + Shift + .

MongoDB

Mongo Sample find query db.getCollection("user").find( { "username" : "kia" }, {//projections "username": 1.0, //1.0 means include...

Expo for React Native

Install expo-cli. If on Mac you get any permission errors then run as sudo npm install expo-cli --global Create expo project expo init...

Commentaires


bottom of page