Making a single change to SVN
Is it possible to commit one change to SVN without any changes to the file?
For example, I have a file, config.properties, sourced under SVN, and my local copy of that file contains numerous changes that are only relevant to my local environment. However, I want to commit a new entry in this file so that my teammates can bring it up, but I don't want to lose my local changes.
Is there a way to do this?
source to share
Itβs not easy. But the workaround is:
- copy the modified config.properties settings somewhere securely outside the working directory.
- revert config.properties
- apply only the changes you want to commit in config.properties
- commit config.properties
- copy a backup (safe copy) on top of config.properties in your working folder to revert your changes that you don't want to comment.
source to share
In your particular case, I offer a second tacit suggestion. I never leave live copies of my config files in the repo, only the template files. This has other advantages: you will never accidentally overwrite your production config files on upgrade, you can store sensitive information like database passwords from the repository, and everyone can have their own development setting that suits their needs / preferences ... When a new config line is required, just test it in the template and tell other developers what they need to merge them with their local copies. (Or maybe look at abstracting the config file into one that changes with every environment (db connection, etc.), and one that doesn't change (constants,language characters, etc.) and which may be part of the repo.
However, since the overall need for a single line merge varies across the repo, Orbman and jeffamaphone are correct. (Orbman got my vote for the most complete answer, but I already voted for SilentGhost.)
source to share