Reputation: 3191
I thought there would be an obvious solution but can't seem to find it. I have a repo with a configfile that changes from machine to machine -
I I do git rm --cached myconfig.conf
and make a file called myconcif.template.conf
- this mostly works, but if I switch branches locally and then switch back myconfig.conf
ends up getting removed.
What I want is to be able to keep myconfig.conf
changes committed locally, but have them ignored for both repository push and pull.
Upvotes: 0
Views: 255
Reputation: 17481
After doing git rm --cached myconfig.conf
you need to add it to the .ignore
file.
Adding it to the ignore file means that the file will be ignored not only for pull and push, but for switching branches too.
If you want local myconfig.conf to change with each branch without having it versioned, I'm afraid you can't.
Edit: sometimes git seems to be stubborn about this procedure, so a dirty workaround is just:
Upvotes: 1