目标:创建一个新的存储库,没有不必要的文件,占用1.27 GB
解决方案:使用hg转换并排除文件
问题:文件未被排除
Filemap.txt内容:
exclude "feturehub/wp-content/uploads/backupbuddy_backups"
exclude "feturehub/wp-content/uploads/edd/2015"
命令
hg convert --filemap filemap.txt featurehub featurehubclean
正在从featurehub(src)的父文件夹运行,src也包含filemap.txt
我得到的是一个只包含.hg文件夹的文件夹,其中包含我想要排除的edd文件夹(如果edd或者其'2015子文件夹被排除,它是相同的,2015年是edd文件夹中唯一的东西)。
编辑:删除了filemap.txt中的第三行,因为它不会影响结果,但会造成混淆。
EDIT2:
// fe is my source root, no there's no hg repo here, and each folder IS
// a project with an hg repo, featurehub is one such project/repo
AndrijaMBA:fe ajambrovic$ ls | grep file
filemap.txt
AndrijaMBA:fe ajambrovic$ hg convert --filemap filemap.txt featurehub featurehubclean
initializing destination featurehubclean repository
scanning source...
sorting...
converting...
.....
运行命令后,新的repo,featurehubclean包含edd文件夹(及其子文件夹)。
答案 0 :(得分:0)
好的,问题很简单 - 路径。而不是:
exclude "feturehub/wp-content/uploads/backupbuddy_backups"
exclude "feturehub/wp-content/uploads/edd/2015"
我应该用
exclude "wp-content/uploads/backupbuddy_backups"
exclude "wp-content/uploads/edd/2015"
此处的示例:https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html显示使用(在本例中)" featurehub",即使扩展文档声明:
所有路径都应指定为以为根的相对路径 转换后的目录。无论如何都应该使用Unix路径语法 OS。