How do I stop tracking changes to a file after the commit?

Asked

Viewed 830 times

2

I have a file .properties already committed and would like to stop tracking the changes made to it. Each user who clone the project will configure it in their own way.

I tried that command:

git rm --cached application/src/main/resources/props/services.properties

Does not return me any error or success message, I do not know if I should too.

But even then, after this command, if I make any changes to the file git finds the difference and lists the file as modified. What am I missing?

1 answer

4


You’re on the right track. The problem is that just removing the file won’t stop git from tracking modifications.

Entire process:

  1. git rm --cached
  2. Add the file in question to .gitignore
  3. git commit

This removes the file and stops tracking new modifications. The commit is necessary to carry out operations.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.