首先看下清理之前的目录大小 # bowang @ localhost in ~/mytest/scmtest on git:master o [10:05:08]$ du -ah······20K ./.git/objects/pack/pack-3f4446b1e86d2111d80dd9ffd0ca30c3669f9145.idx18M ./.git/objects/pack
代码原文: def remove_offline_messages(file_path):try:# 打开文件并读取所有行with open(file_path, 'r', encoding='utf-8') as file:lines = file.readlines()# 过滤掉包含'pc消息离线pcadmin'的行filtered_lines = [line for line in lin