Sometimes you're developing and you decide to commit, forgetting you created a few files on your project. Then a few days down the line your buddy gets your build out of Subversion and complains that some files appear to be missing. You realize, ah crap, I forgot to add those files!
有时您正在开发并且您决定提交,忘记您在项目中创建了一些文件。然后几天下来你的伙伴从Subversion获取你的构建并抱怨一些文件似乎丢失了。你意识到,啊垃圾,我忘了添加那些文件!
How can I get a list of the files that are not under version control from Subversion so I'm sure I've added everything to the repository?
如何从Subversion获取不受版本控制的文件列表,所以我确定我已将所有内容添加到存储库中?
5 个解决方案
#1
101
Use the svn status
command:
使用svn status命令:
svn status | grep ^?
Files that are not versioned are indicated with a ? at the start of the line.
未版本化的文件用?表示?在线的开头。
If you find that you always have some specific files that should not be added to the repository (for example, generated binaries), you should set up the svn:ignore
property on the containing directory so these files won't keep showing up when using svn status
.
如果您发现总是有一些不应该添加到存储库的特定文件(例如,生成的二进制文件),则应在包含目录上设置svn:ignore属性,以便这些文件在使用时不会一直显示svn状态。
#2
42
If some files have had ignore
added to their status, they won't show up in svn status
. You'll need:
如果某些文件已将忽略添加到其状态,则它们将不会以svn状态显示。你需要:
svn status --no-ignore
#3
15
If you're running on Windows, you could do something similar to Greg Hewgill's answer using PowerShell.
如果你在Windows上运行,你可以使用PowerShell做类似于Greg Hewgill的回答。
(svn stat) -match '^\?'
This could be extended pretty easily to find all unversioned and ignored files and delete them.
这可以很容易地扩展,以找到所有未版本化和被忽略的文件并删除它们。
(svn stat "--no-ignore") -match '^[I?]' -replace '^.\s+','' | rm
Hope that's helpful to someone!
希望对某人有帮助!
#4
11
Or from the Windows command line:
或者从Windows命令行:
svn stat | find "?"
#5
0
You can use this command to list all paths for not-versioned files:
您可以使用此命令列出非版本化文件的所有路径:
svn status | awk '/^?/ {print $2}'
The first part will do an svn status
, and then it will redirect the output to AWK which will do simple filter "first character should be '?'" then it will print the second parameter "which is the file path".
第一部分将执行一个svn状态,然后它将输出重定向到AWK,这将做简单的过滤器“第一个字符应该'?'”然后它将打印第二个参数“这是文件路径”。
svn status
will always not print ignored files. You can add a file or path by adding that path using
svn status将始终不会打印被忽略的文件。您可以通过使用添加该路径来添加文件或路径
svn propset svn:ignore "PATH OR PATERN"
#1
101
Use the svn status
command:
使用svn status命令:
svn status | grep ^?
Files that are not versioned are indicated with a ? at the start of the line.
未版本化的文件用?表示?在线的开头。
If you find that you always have some specific files that should not be added to the repository (for example, generated binaries), you should set up the svn:ignore
property on the containing directory so these files won't keep showing up when using svn status
.
如果您发现总是有一些不应该添加到存储库的特定文件(例如,生成的二进制文件),则应在包含目录上设置svn:ignore属性,以便这些文件在使用时不会一直显示svn状态。
#2
42
If some files have had ignore
added to their status, they won't show up in svn status
. You'll need:
如果某些文件已将忽略添加到其状态,则它们将不会以svn状态显示。你需要:
svn status --no-ignore
#3
15
If you're running on Windows, you could do something similar to Greg Hewgill's answer using PowerShell.
如果你在Windows上运行,你可以使用PowerShell做类似于Greg Hewgill的回答。
(svn stat) -match '^\?'
This could be extended pretty easily to find all unversioned and ignored files and delete them.
这可以很容易地扩展,以找到所有未版本化和被忽略的文件并删除它们。
(svn stat "--no-ignore") -match '^[I?]' -replace '^.\s+','' | rm
Hope that's helpful to someone!
希望对某人有帮助!
#4
11
Or from the Windows command line:
或者从Windows命令行:
svn stat | find "?"
#5
0
You can use this command to list all paths for not-versioned files:
您可以使用此命令列出非版本化文件的所有路径:
svn status | awk '/^?/ {print $2}'
The first part will do an svn status
, and then it will redirect the output to AWK which will do simple filter "first character should be '?'" then it will print the second parameter "which is the file path".
第一部分将执行一个svn状态,然后它将输出重定向到AWK,这将做简单的过滤器“第一个字符应该'?'”然后它将打印第二个参数“这是文件路径”。
svn status
will always not print ignored files. You can add a file or path by adding that path using
svn status将始终不会打印被忽略的文件。您可以通过使用添加该路径来添加文件或路径
svn propset svn:ignore "PATH OR PATERN"