Best android open-source packages and libraries.

DevUtils repo

:honeybee: 该项目是针对 DevUtils 第三方库封装扩展、新技术 Demo 编写、大文件资源等迁移存储仓库。
Updated 1 month ago

DevUtils-repo

Profile License Version API

🐝 该项目是针对 DevUtils 第三方库封装扩展、新技术 Demo 编写、大文件资源等迁移存储仓库。

Android 规范 Java 规范 Git 规范

作用

减少 DevUtils 仓库大小方便快速 clone,并让 DevUtils 项目更加纯粹只保留 Dev 系列开发库相关代码。

移除多余的第三方库、插件依赖配置,避免过多无关且繁杂配置影响快速理解项目,降低第三方库下载数量、编译运行 DevUtils 演示 Demo App 难度,使项目可更加快捷运行。

仓库优化前后对比

before after

优化后仓库大小为 12.7MB,相较之前减少了 56.4MB

如何彻底删除 Git 中的大文件、敏感数据

可以参考 GitHub 官方文档 Removing sensitive data from a repository 或使用开源工具 BFG Repo-Cleaner

下方以 BFG Repo-Cleaner 为例,演示优化 DevUtils 仓库空间大小步骤及命令。

  1. 首先通过 BFG Repo-Cleaner 下载 bfg.jar 后 clone 项目。
git clone --mirror https://github.com/afkT/DevUtils.git
  1. 接着执行删除文件、文件夹命令。
java -jar /Users/afkT/bfg.jar --strip-blobs-bigger-than 1M /Users/afkT/DevUtils.git

上行命令表示删除大于 1MB 的所有文件,具体其他命令可以查看 BFG API

执行结果:

deleted_files

还有如删除文件夹

java -jar /Users/afkT/bfg.jar --delete-folders interesting /Users/afkT/DevUtils.git

删除文件

java -jar /Users/afkT/bfg.jar --delete-files image.zip /Users/afkT/DevUtils.git
  1. 执行删除命令结束后,存在符合条件则调用 git gc。
cd DevUtils.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
  1. 最后一步强制推送 git。
git push --force

注意事项:删除数据后,需要重新 clone 项目,因为 .git 隐藏文件存在历史数据,如果在原有 project.git 上面提交又会再次 push 上去。

至此优化项目仓库大小,删除大文件、敏感数据操作结束。

License

Copyright 2022 afkT

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.