How to set svn:ignore with multiple values?

Svn

Svn Problem Overview


Let's say I want to set the svn:ignore property for directory dir1 with multiple values, file1, file2, and file3. How can I do this via command line, without using a text editor (to set the property value)?

Svn Solutions


Solution 1 - Svn

Type exactly like here with line breaks:

svn propset svn:ignore "file1
file2
file3" dir1

If you want to pass a list from another command, try xargs. Unfortunately, the svn command doesn't allow reading from stdin with -F -.

Solution 2 - Svn

One line solution:

svn propset svn:ignore "file1"$'\n'"file2"$'\n'"file3" dir1

Solution 3 - Svn

Adding multiple entries is much easier. Use the following command:

svn propedit svn:ignore .

This will open a text editor. Now you can add multiple entries easily.

Solution 4 - Svn

Use:

cat > ignorelist << END
file1
file2
file3
END

svn propset svn:ignore -F ignorelist dir1

Or without an external file, and assuming you're on Linux or a system with /dev/fd:

svn propset svn:ignore -F /dev/fd/0 dir1 << END
file1
file2
file3
END

Solution 5 - Svn

In powershell:

$ignore = "*.dll`n*.xml"
svn propset svn:global-ignores $ignore .

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSnowcoreView Question on Stackoverflow
Solution 1 - SvngertasView Answer on Stackoverflow
Solution 2 - SvnJan.JView Answer on Stackoverflow
Solution 3 - SvnSMRView Answer on Stackoverflow
Solution 4 - SvnchrisdowneyView Answer on Stackoverflow
Solution 5 - Svnb_levittView Answer on Stackoverflow