当前位置: 首页 > 工具软件 > ViewSVN > 使用案例 >

view current svn project‘s ignore files

夔学智
2023-12-01

前言

最近已经将版本控制转到了git.

git方便的地方是,从公司git目录签到本地后,如果在现场或封闭开发时,有了任何进度,可以向本地提交,到公司之后再push到公司的git目录,这样就不会有svn提交必须连接服务器的问题。保证开发过程归档顺畅,不至于版本控制服务器离线,引起的各种不便。

今天在调试板子,准备将svn的工程整个拷贝到git目录,然后add, commit.
突然发现一个问题,这个工程用svn归档时,有好多临时文件是ignore的,我就这么拷贝过来,那些ignore文件我是要手工先删除的,然后才能git操作。

那我以前在svn中ignore的文件具体是哪些呢?
特别是,如果要迁移进git的工程是同事弄的或是第三方的svn工程,我咋知道他ignore了哪些svn文件?

在stackoverflow找到了答案。使用 svn proplist -Rv 可以搞定。

实验

先建立一个测试用的svn目录,内容如下。

Microsoft Windows [版本 10.0.19043.1110]
(c) Microsoft Corporation。保留所有权利。

C:\Users\chenx>cd /d D:\my_dev\local_svn_checkout\doc\test_svn_ignore

D:\my_dev\local_svn_checkout\doc\test_svn_ignore>dir /s /b
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir1
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir2
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\file1.txt
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\file2.txt
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir1\file1.txt
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir1\file2.txt
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir1\file3.txt
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir2\dir2_1
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir2\file1.txt
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir2\file2.txt
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir2\dir2_1\file1.txt
D:\my_dev\local_svn_checkout\doc\test_svn_ignore\dir2\dir2_1\file2.txt

D:\my_dev\local_svn_checkout\doc\test_svn_ignore>

将子目录中的几个单个文件,和一个目录都ignore掉。
好了,现在假装这个svn工程是别人的,我不知道哪些是ignore掉的文件。

D:\my_dev\local_svn_checkout\doc\test_svn_ignore>svn proplist -Rv > .\log.txt

查看log.txt

Properties on 'dir1':
  svn:ignore
    file3.txt

    
Properties on 'dir2':
  svn:global-ignores
    dir2_1

可以看到带有 svn:ignore 和 svn:global-ignores 属性的文件或目录,就是当前svn工程目录的ignore文件或目录。

svn迁移到git归档

  • 尝试在原来的svn目录,模拟add和commit,将未svn归档和不需要svn归档的文件处理完。

  • 将svn工程拷贝到git目录,在git归档前,先手工将log.txt中记录的文件和目录删掉,再git归档,归档的全部是有效的工程文件。

 类似资料:

相关阅读

相关文章

相关问答