我是一个完全不懂git的新手,感到非常困惑。我相信我错过了一些基本的东西。
问题如下:
- I committed and pushed large files (~2Gb) to a repository. Then I removed them - committed - pushed, but they are still in the history. I need to shrink the repository somehow.
- First, I followed how to shrink a git repository. I could only shrink the local version, but when I tried to push, it said that I have to pull first. Pulling, however, would bring the big history files back.
Similar to revert multiple git commits, I removed completely the last two commits by doing twice
git reset --hard HEAD^ git push -f origin master
Now, I can not see the last two commits in git log, but the repository/history is still big.
- As the files are not in the history anymore, I can not remove deleted files from git history, as git does not see them.
假设我是这个代码库的唯一使用者,历史记录没有价值,我只是需要缩小代码库的大小。但是,我只能在本地进行更改,然后将它们推送到代码库中,因此,完全删除代码库不起作用。
rm -rf .git
删除git后,我将无法进行推送操作。
删除git对我有多大的影响?我该如何实现我的总体目标?如果有任何建议,我将不胜感激。提前致谢。
git rm
还是普通的rm
命令? - jub0bs