Git在分支后发送大量数据
我有一个包含大量二进制文件(大约 250MB)的存储库 - 我不知道这是否重要。
我正在创建一个新分支并尝试将其发布到中央服务器上:
git checkout -b newbranch
git push origin newbranch:newbranch
现在,git 正在尝试将 30MB 的数据推送到服务器。 为什么??没有任何变化。
还尝试制作捆绑包:
git bundle afile master..newbranch
fatal: Refusing to create empty bundle.
有什么问题吗?
I have a repository with lots of binary files (about 250MB) - I don't know if that is important.
I'm making a new branch and trying to publish it on the central server:
git checkout -b newbranch
git push origin newbranch:newbranch
Now here, git is trying to push 30MB of data to the server.
Why?? There are no changes.
Also tried to make a bundle:
git bundle afile master..newbranch
fatal: Refusing to create empty bundle.
What is wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这与 git 存储数据的方式以及推送的工作原理有关。我猜测推送新分支并不是导致数据传输的原因,而是也推送了原点中缺少的先前提交。
这就是为什么 git 对于日志文件来说是一个非常糟糕的主意 - 我倾向于将它们添加到 .gitignore 文件中,这样它们就永远不会被提交,即使是错误的:)
It's to do with the way git stores the data and how a push works. I'm guessing that pushing the new branch is not what's causing the data transfer but a previous commit that's also missing from origin is being pushed as well.
This is why git's a very bad idea for log files - I tend to add them to the .gitignore file so they never get committed, even by mistake :)
也许不是一个有用的答案,但我尝试了这个确切的事情,并且 git 没有发送任何对象。所以也许那里有一个提交,而你没有意识到。
Maybe not a useful answer, but I tried this exact thing, and git didn't send up any objects. So maybe there was a commit in there, and you didn't realize it.