开发者

How do you commit ONLY files you've "added" to version control in subclipse?

开发者 https://www.devze.com 2022-12-11 18:00 出处:网络
I just spent a fair amount of time selecting the files and directories I wanted under version control. I\'m running subclipse under eclipse. I right clicked, Team, Add to Version Control. Now I want O

I just spent a fair amount of time selecting the files and directories I wanted under version control. I'm running subclipse under eclipse. I right clicked, Team, Add to Version Control. Now I want ONLY those files committed without 开发者_运维问答right clicking the whole directory which contains a huge number of media files that I don't want handled by version control. If I go Team/Commit under that directory it hangs for a very long time... I thought by "Add to Version Control" there was an option to commit those files only. I just don't know how to do it.

I hope I explained the question properly..

UPDATE: Since people are talking more about ways to ignore files rather than committing what you're marked as "Add"ed to Version Control, let me put this a different way. What does "Add to version control" do exactly? It seems to be a feature without use.


Subclipse includes both unversioned files and files you specifically marked for addition when you open the commit dialog. It does not perfectly mirror the behavior of the command-line client. You have two options: uncheck each file you do not want to commit in the Subclipse commit dialog or use the command-line svn tool to commit. The command-line tool will only commit files you have marked for addition and will ignore the other files. Here's a simple example:

$ touch file
$ svn status
?       file
$ svn add file
A         file
$ svn status
A       file
$ touch file2
$ svn status
?       file2
A       file
$ svn commit -m "Added empty file"
Adding         file
Transmitting file data .
Committed revision 2.

? denotes a file that it unknown to svn and will not be put under version control automatically by svn commit. A denotes a new file that is scheduled for addition. Subclipse is trying to mirror this behavior by allowing you to "add a file to version control", which is the equivalent of the command-line svn add. but also includes unversioned files not scheduled for addition in its commit dialog (which I personally find somewhat annoying). If you run svn status on the command-line, those files which you "added to version control" in Subclipse will be marked with an A while those you did not will be marked with a ?. You won't have to run any svn add commands since you did that already in Subclipse.


You can add a pattern in Preferences/Team/Ignored resources (it's not the same as svn:ignore). You can also delete it, if it is no longer helpful.


use svn:ignore for the resources you don't need under version control (Team > Add to svn:ignore)

0

精彩评论

暂无评论...
验证码 换一张
取 消