Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn ignore anymore changes to a file that is held/tracked by svn [duplicate]

Tags:

svn

There are situations where as part of development environment setup, certain files are distributed with default settings and these files are checked in to svn. But we do not want the users to commit local modifications to these files accidentally.

Is there a way possible in svn to do this? I am aware that svn:ignore does not work on files that are already checked in. Or is there a different practice to achieve the same results?

like image 999
Rag Avatar asked Feb 07 '12 17:02

Rag


People also ask

What does svn ignore do?

The svn:ignore property is a good way to tell Subversion to ignore files that are likely to be present in every user's working copy of that directory, such as compiler output or—to use an example more appropriate to this book—the HTML, PDF, or PostScript files generated as the result of a conversion of some source ...

What is svn add?

The svn add command allows you add files or a directories to your locally checked out tree in preparation for committing them to the svn server. And as you may guess, the svn rm command tags a file in your local checkout for removal on the server upon your next commit.


2 Answers

The usual approach is completely omit such file (via svn:ignore) and commit a template instead. The user is expected to copy the template and tweak the copy to his liking:

http://subversion.apache.org/faq.html#ignore-commit

I have a file in my project that every developer must change, but I don't want those local mods to ever be committed. How can I make 'svn commit' ignore the file?

The answer is: don't put that file under version control. Instead, put a template of the file under version control, something like "file.tmpl".

Then, after the initial 'svn checkout', have your users (or your build system) do a normal OS copy of the template to the proper filename, and have users customize the copy. The file is unversioned, so it will never be committed. And if you wish, you can add the file to its parent directory's svn:ignore property, so it doesn't show up as '?' in the 'svn status' command.

like image 120
Álvaro González Avatar answered Sep 21 '22 14:09

Álvaro González


It depends on the Client you're using. Tortoise, for example, has Changelists. You can put files on an ignore-on-commit changelist and by default when you come to check-in your code, they won't be ticked. Other clients such as Smart SVN have similar functions.

like image 33
DaveShaw Avatar answered Sep 20 '22 14:09

DaveShaw