I am working in a shared git repository. In our project, we have a configuration.json
file that holds information to some parameters for the project. Sometimes when I am working on my local repository, I change the contents of configuration.json
to test things out, but always end up discarding my changes because I don't want to commit my 'tested' changes.
If I don't track configuration.json
, then committing would cause the whole file to disappear from the repository on github, since the github repository originally has the file, and by committing my local version of the repository (which does not have the configuration.json
tracked) would cause me to commit my local version of the repository which does not have configuration.json
anymore.
Usually how I work around this is by discarding my changes manually, which is not the best solution because sometimes I want to commit my other changes within the project, while keeping my changes of configuration.json
in my local device, without actually committing it to the shared repository on github.
Is there a way to be able to not track my changes to a file, while not causing it to disappear when i make commits to the github repository?