Victor Leung
Victor Leung
BlogFlower shop

Git ignore already modified files

March 18, 2020

I encounter a rare scenario that there is a file modified, but I don't want to commit this change on git. There are many ways to do such as .gitignore file, but it doesn't work when the file already tracks.

The solution here is to manually ignore the file by entering this command:

    git update-index --assume-unchanged <file path>

To start tracking again, revert by using this command:

    git update-index --no-assume-unchanged <file path>

Feel free to reach out if you have any questions.


About Victor Leung

Software development professional with expertise in application architecture, cloud solutions deployment, and financial products development. Possess a Master's degree in Computer Science and an MBA in Finance. Highly skilled in AWS (Certified Solutions Architect Professional, Developer and SysOps Administrator), GCP (Professional Cloud Architect), Microsoft Azure, Kubernetes(CKA, CKAD, CKS, KCNA), and Scrum(PSM, PSPO) methodologies.

Happy to connect
LinkedIn
Github
Twitter
@victorleungtw

Continuous improvement

Copyright © victorleungtw.com 2023.