包含标签 git 的文章

从git中永久删除文件

有时候历史提交添加过比较大的文件或者敏感文件, 后面也删掉了, 可是git历史记录里面还有, 也会占用空间. 这时候就要用下面的方法来永久删除了. 运行底层命令git verify-pack以识别出大对象, 对输出的第三列信息即文件大小进行排序 $git verify-pack -v .git/objects/pack/pack-6d6...b0b.idx -v | sort -n -k 3 | tail -5 034...2c4 blob 8943 3472 21832 ec2...08b blob 11117 3081 29005 270...9e8 blob 12687 4841 14122 d57...91a blob 17888 5654 41757 829...3e7 blob……

阅读全文

Repo 常用命令

repo介绍 Android 使用 Git 作为代码管理工具, 开发了 Gerrit 进行代码审核以便更好的对代码进行集中式管理, 还开发了 Repo 命令行工具,对 Git 部分命令封装,将百多个 Git 库有效的进行组织. 源代码标记和细分版本 https://source.android.google.cn/setup/start/build-numbers#source-code-tags-and-builds 使用国内源 export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo' export REPO_URL='https://gerrit-googlesource.proxy.ustclug.org/git-repo' 建立本地镜像 repo init -u git://mirrors.ustc.edu.cn/aosp/mirror/manifest --mirror repo sync /usr/bin/git daemon --verbose --export-all --base-path=/mnt /mnt/mirror-aosp 初始化repo repo init -u git://127.0.0.1/mirror-aosp/platform/manifest repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-8.0.0_r1 下载代码 repo sync 查看全部版本 cd .repo/manifests git……

阅读全文