top of page
Search

Git

  • Writer: Kiazsoft
    Kiazsoft
  • Dec 14, 2020
  • 1 min read

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 .

 
 
 

Recent Posts

See All
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...

 
 
 

Comments


©2022 KIAZSOFT CONSULTING INC

bottom of page