How do I svn:ignore with AnkhSVN?

2019-04-20 15:56发布

问题:

I am so unbelievably retarded when it comes to Subversion/AnkhSVN. I just don't get it at all. Anytime I do anything outside of updating and committing, everything blows up in my face.

These are my beliefs (which must be incorrect because i can't get Ankh to ignore anything)

  1. svn:ignore is a tool to make your Subversion client always leave certain files or directories OUT of update and commit lists. So, whenever you change any file that's being ignored, Ankh will never try to commit the change nor will it ever update the file. It's essentially invisible to your Subversion client
  2. In order to ignore a file using AnkhSVN, you must
    • right click on the directory in which the file resides
    • select Subversion->Subversion Properties
    • add a new Subversion property with name 'svn:ignore' and in the values box i enter newline-delimited list of things like '*.log' in order to ignore everything file file extension .log in THAT directory.

My assumptions are most certainly incorrect as I've never ever been able to get svn:ignore to work for me. Can anyone please revert me back to sanity by explaining to me which of my assumptions are incorrect and how I'm supposed to approach this?

Thank you.

回答1:

The first assumption is indeed wrong. svn:ignore only works for unversioned files, it keeps them from being added when you do a recursive add. It's most useful on the command line for that reason.

In AnkhSVN there's a much easier way to add files to the svn:ignore list. Right click any unversioned file and choose Subversion -> Ignore. Inside are options to ignore the single file, all files with the extension etc.

You can right click a changed/added file (hint: use View - Pending Changes to see them all) and click Subversion -> Move to Change List -> ignore-on-commit. This is a change list that AnkhSvn and TortoiseSvn to have the items deselected by default. You can still commit them when you explicitly select them though