1422

Git瘦身,删除历史大文件

找到大文件

git verify-pack -v .git/objects/pack/pack-*.idx | sort -k 3 -g | tail -5
Shell

查看文件路径

git rev-list --objects --all | grep <ID>
Shell

查看前因后果,历史提交。以public/test.mp4为例

git log --pretty=oneline --branches -- public/test.mp4
Shell

如果需要知道commit id所在的分支,使用命令

git branch -a --contains <COMMIT ID>
Shell

删除大文件

2911

Windows10 git-bash 安装 zsh 和 oh_my_zsh 或 prezto

安装git-bash for windows

https://gitforwindows.org/
下载安装一直下一步即可

下载zsh

https://dotatong.cn/tools/zsh-5.8-3-x86_64.pkg.tar

下载后解压到 Git 安装的根目录,相当于对git bash做一个补充包。

安装oh_my_zsh

安装oh_my_zsh(MacOS也可使用该步骤安装oh_my_zsh)

sh -c "$(curl -fsSL https://dotatong.cn/tools/oh_my_zsh.sh)"
Shell
22831

Git常用操作备忘

此文来源网络,内容略微修改

Git Flow代码示例

1.创建develop分支

git branch develop
git push -u origin develop
Bash

2.开始新Feature开发