Git/清理:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
第18行: 第18行:
// 推送新的主分支到远程
// 推送新的主分支到远程
</syntaxhighlight>|$|/home/kangkk}}
</syntaxhighlight>|$|/home/kangkk}}
== 大文件 ==
检索 git 项目目录
{{shc|<syntaxhighlight lang="bash">
git rev-list --objects --all</syntaxhighlight>|$|/home/kangkk}}
延申出
{{shc|<syntaxhighlight lang="bash">
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -5 | awk '{print$1}')"</syntaxhighlight>|$|/home/kangkk}}
删除大文件
{{shc|<syntaxhighlight lang="bash">
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch <文件路径名称>' --prune-empty --tag-name-filter cat -- --s</syntaxhighlight>|$|/home/kangkk}}