Posts
Modifying a File Locally Without Updating the Remote Git Repository
April 5, 2024 • 1 min read
Have you ever needed to modify a file locally without committing the changes to the remote repository?
I’m collaborating on a project where software engineers share settings. However, some settings are specific to each engineer. If we commit our custom settings, it disrupts the other engineers.
Previously, we used .gitignore and kept a local copy, but this method ignores the entire file, which isn’t ideal when some shared settings are still needed.
Thankfully, Git has a solution!
Git features an –assume-unchanged command:
git update-index --assume-unchanged <file-path>
Replace <file-path> with the path of the file whose changes you want to ignore. This command instructs Git to temporarily disregard changes to the file, which is handy for configuration files you don’t want to commit.
Author: Chuck Conway is an AI Engineer with nearly 30 years of software engineering experience. He builds practical AI systems—content pipelines, infrastructure agents, and tools that solve real problems—and shares what he’s learning along the way. Connect with him on social media: X (@chuckconway) or visit him on YouTube and on SubStack.