Mac上的Versions应用默认不显示.a文件,但是工程里有时会用到第三方的.a文件,所以很不方便。
在网上找到两种添加.a文件的方法,但都不太优雅:
- 第一种方法是用终端进入.a文件的目录,执行
svn add *.a
命令。缺点是要找到.a文件所在的目录,手动执行命令比较花时间。 - 第二种方法是点击菜单
View
--Show Ignored Items
,这样SVN工具里会列出所有被忽略的文件,再找到.a文件添加。缺点是会看到一大堆不想用到的文件,给寻找.a文件带来麻烦。
其实还有一种自动显示.a文件的方法,点击Versions的菜单Help
--Versions Help
,在弹出的帮助窗口里选择Frequently Asked Questions
--Using Global Ignores
,可以看到以下帮助:
Using Global Ignores
Sometimes, it can be annoying to see uninteresting, unversioned items—for example, files that result from a program's compilation. The Subversion global-ignores option is a whitespace-delimited list of names of files and directories that Subversion should not display unless they are versioned. The default values are: .o *.lo *.la *.al .libs *.so *.so.[0-9] .a *.pyc *.pyo *.rej *~ ## .#* .*.swp .DS_Store.If you want to change this default list follow these steps:
- Click the Go main menu item in the Finder, and click the Go To Folder... menu item.
- Paste the following path ~/.subversion/ and click on Go
- A new Finder window will open that will contain several files
- Open the file named config in your text editor of choice
- Please be careful while editing this file, it contains many settings, accidentally changing something can have unforeseen consequences
- Do a search for global-ignores and you will find that list of default values as shown above
- Now make any edit you want to the list, and remove the # character at the start of the line to make the ignore active
- Save the file and you are all set.
大意就是:
SVN有一个全局的文件忽略列表,SVN不会显示列表里包含的文件,除非这些文件已经添加到SVN里了。文件忽略列表默认值是
*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp .DS_Store.
。如果你想修改默认列表的话,可以按下面的步骤操作:
- 点击Finder的菜单
前往
——前往文件夹...
- 把路径
~/.subversion/
粘贴进去,点击前往按钮- 这时会打开一个新窗口,里面有一些文件
- 用文本编辑器打开名为
config
的文件- 需要注意的是,这个文件里面有一些比较危险的设置,所以不要乱改
- 搜索
global-ignores
关键字,你可以找到一个上面提到的默认的文件忽略列表- 然后编辑这个列表,把最前面的注释符
#
去掉- 保存文件,完成。
如果想要显示.a文件的话,只需把*.a
去掉就行了。
最好复制出两行配置再修改,结果如下:
# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo
# *.rej *~ #*# .#* .*.swp .DS_Store
global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.pyc *.pyo
*.rej *~ #*# .#* .*.swp .DS_Store