当我尝试使用命令来精简我的repo时:
git filter-branch --force --tree-filter 'rm -rf `/Volumes/RamDisk/FF/large_files.txt | cut -d " " -f 2` ' --prune-empty master我在我的控制台中得到输出:
Rewrite 072caf825338a50130903528862caa12cebd1c87 (1/3214)/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-filter-branch: line 318: /Volumes/RamDisk/FF/large_files.txt: Permission denied
Rewrite 2e7c35b1dd73b2b2ceb010a3cd98ad6906b0716e (2/3214)/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-filter-branch: line 318: /Volumes/RamDisk/FF/large_files.txt: Permission denied...large_files.txt只是一个包含要删除的文件列表的文本文件,我拥有它并拥有所有权限:
-rwxrwxrwx 1 luka staff 6983 3 Oct 23:00 large_files.txt我确定.git-rewrite不在repo中(已删除),并且强制标志没有帮助吗?
这到底是关于什么权限的?文件系统权限、Git远程权限或其他?这是我的回购,我有它的完全访问,尝试与sudo和,没有任何帮助。顺便说一句: large_files.txt只是一个包含要删除的文件列表的文本文件,
你能帮我理解一下我错过了什么吗?
发布于 2014-10-05 15:33:18
您正在尝试执行large_files.txt (请注意您的--tree-filter参数中的`字符中的内容)。当您尝试执行一个不可执行的文件时(即使您乐观地将其权限设置为a+x),shell会显示“权限被拒绝”,这可能会让人感到困惑。你可能想在里面的某个地方放个cat,不是吗?
顺便说一句,使用xargs可能比仅仅在rm的参数中扩展它更安全。例如:
cut -d " " -f 2 /Volumes/RamDisk/FF/large_files.txt | xargs rm -rfhttps://stackoverflow.com/questions/26187162
复制相似问题