gpt4 book ai didi

git - 从存储库中删除文件

转载 作者:太空狗 更新时间:2023-10-29 12:46:16 25 4
gpt4 key购买 nike

我知道已经有一百万个类似的问题,但我不确定它们是否适用。我是 git 的新手,并且在 github 上托管了一个项目。我不小心在存储库中添加了一些大日志文件。当我注意到它时,我 git rm-ed 它们然后 commit-ted 更改。这似乎已经完成了工作,因为当我克隆存储库时,我只得到了我想要的文件(源代码)。然而,克隆现在需要永远,因为,我假设,git 出于某种原因仍在下载这些日志文件(.git 存储库现在很大,尽管主要项目文件重一兆左右)。我现在怎样才能摆脱这种肿胀?

非常感谢

最佳答案

您可以尝试关注 GitHub guide "remove sensitive data"

From time to time users accidentally commit data like passwords or keys into a git repo. While you can use git rm to remove the file, it will still be in the repo’s history. Fortunately, git makes it fairly simple to remove the file from the entire repo history.

关于git - 从存储库中删除文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2730411/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com