关于"如何从repo中删除意外添加的大文件"有很多SO问题,其中许多建议使用git gc命令.但是,我发现它不适合我,我不知道出了什么问题.
这是我做的:
$ git init
Initialized empty Git repository in /home/wzyboy/git/myrepo/.git/
$ echo hello >> README
$ git add README
$ git commit -a -m 'init commit'
[master (root-commit) f21783f] init commit
1 file changed, 1 insertion(+)
create mode 100644 README
$ du -sh .git
152K .git
$ cp ~/big.zip .
$ git add big.zip
$ git commit -a -m 'adding big file'
[master 3abd0a4] adding big file
1 file changed, 0 insertions(+), 0 deletions(-)
create mode …Run Code Online (Sandbox Code Playgroud)