robertgarrigos's picture

Hey, I wanted to ask you how do you work with .gitignore on your fork of backdrop: .gitignore includes an entry for it self, but as it is already tracked, any local changes to  the file will be pushed to my fork and added to the eventual PR I made for the upstream. So I need to untrack it.

git rm --cached .gitignore indeed untracks locally the file, but it also deletes the file in my fork repo and would delete it in a PR.

Thus, how do you do to change your local .gitignore without pushing its changes?

Thanks!!

Accepted answer

This is the answer I've found: use of the command:

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

Complete solution: https://stackoverflow.com/a/50375706/11249749

 

 

Comments

@robertgarrigos Thanks, this is useful.

That's a good solution. I've usually just added files individually to avoid adding that file. But simplifies the workflow.