· Chuck Conway  · 1 min read

Modifying a File Locally Without Updating the Remote Git Repository

Have you ever needed to modify a file locally without committing the changes to the remote repository?

Have you ever needed to modify a file locally without committing the changes to the remote repository?

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.

Back to Blog

Related Posts

View All Posts »
The Benefits of Using a Build Framework

The Benefits of Using a Build Framework

Continuous Integration (CI) and/or Continuous Delivery (CD) is the norm on software projects these days. There are many build servers such as Azure DevOps, TeamCity, Jenkins, and Cruise Control.Net.

NVarchar Vs Varchar

NVarchar Vs Varchar

Each engineer defining a new string column decides: Do I use nvarchar or do I use varchar?