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?

+2


source to share


4 answers


No, It is Immpossible. Just svn check that file in a separate location and make your changes and merge it back into your other changes.



+3


source


I suggest having a template config under svn and ignore the local config. This way you should be able to do what you want: update the template, merge with local config, and you're good to go.



+4


source


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.
+2


source


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.)

0


source







All Articles