0

I have a config file 'config.js' in my Bitbuckt repo with a specific configuration that I don't want to change.

I need to change this file to work locally, but I don't want to send this changes to my repo.

I already put this file in .gitignore but, every time I push my project, the file in Bitbuckt is replaced with local config.

How can I fix this?

PS: I tried to use $ git rm --cached config.js, but this deletes the file in Bitbuckt.

Seralto
  • 1,016
  • 1
  • 16
  • 30

1 Answers1

0

The solution was ignore changes to the file using the command:

git update-index --assume-unchanged file_name

And just an observation, the undo command is:

git update-index --no-assume-unchanged file_name

UPDATED:

I found a problem with this solution. When I try to change branch, I got an error (Your local changes to the following files would be overwritten by checkout:)

How can I solve it?

Seralto
  • 1,016
  • 1
  • 16
  • 30