svn ignore without deleting files?

后端 未结 6 2029
暗喜
暗喜 2020-12-14 18:07

how can I ignore files from my svn repo without deleting them as well?

When I work on existing projects I often have to setup a local version of the project and usin

相关标签:
6条回答
  • 2020-12-14 18:51

    svn propedit svn:ignore ./some_path

    For details see this post.

    0 讨论(0)
  • 2020-12-14 18:57

    From the SVN Help:

    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.

    0 讨论(0)
  • 2020-12-14 18:58

    Create a version of the file called ".template" and version control that. When you checkout rename and edit as you need. Then use the svn propedit svn:ignore to ignore the copy.

    0 讨论(0)
  • 2020-12-14 18:58

    This answer talks about creating a changelist named ignore-on-commit with your template file, it will only work if you are using TortoiseSVN.

    But then, again, this is a per-user setting.

    0 讨论(0)
  • 2020-12-14 19:02

    The easiest way is to go to any directory that contains your config file and set a property on it:

    svn:ignore settings.php

    It will stay as-is through all commits and updates. You command might look like this:

    $ svn propset svn:ignore 'settings.php' ./

    0 讨论(0)
  • 2020-12-14 19:12

    A possible solution would be to use changelists. You can group the files that you are changing into changelists, and then when you svn commit, you specify the changelist -- files not in the changelist are not affected.

    create changelist
    svn changelist math-fixes integer.c mathops.c

    commit only files in changelist
    svn ci -m "Fix a bug." --changelist math-fixes

    0 讨论(0)
提交回复
热议问题