1

I have a repo with a env/ folder. This folder is for personal configurations, but, the file must not be changed in the repo. (i.e: you introduce database data (hosts, ports, passwords), but you don't want the repo to have that info.)

Note, the file has other info as well, so the file must be in the repo. (so no .gitignore)

How can I exclude the file changes when pushing to the origin?

So far, I've been deleting and then adding again the extra info every time I make a push. So I need to change the workflow asap.

Also, the repo is not mine, so I can't add or change much around.

1 Answers1

0

For this there is the update-index command.

Most likely you want something like this:

 git update-index --assume-unchanged [<file>]

And even though that file is tracked git will no longer look for modifications in that file.

Later if you decide to make changes to the file and commit them you can always do this:

git update-index --no-assume-unchanged [<file>]
Vincent Ramdhanie
  • 102,349
  • 23
  • 137
  • 192