Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
git lfs跟踪在裸git回购上失败_Git_Github_Push_Git Push_Git Lfs - Fatal编程技术网

git lfs跟踪在裸git回购上失败

git lfs跟踪在裸git回购上失败,git,github,push,git-push,git-lfs,Git,Github,Push,Git Push,Git Lfs,我正在将SVN回购转换为Git回购。这成功地完成了,现在我有了一个赤裸裸的Git回购tham,我正试图推动GitHub: git push -u origin master 但这会产生一个错误: remote: error: File root/data/big_file.conf is 187.98 MB; this exceeds GitHub's file size limit of 100.00 MB 好的,所以我决定使用lfs: brew install git-lfs git l

我正在将SVN回购转换为Git回购。这成功地完成了,现在我有了一个赤裸裸的Git回购tham,我正试图推动GitHub:

git push -u origin master
但这会产生一个错误:

remote: error: File root/data/big_file.conf is 187.98 MB; this exceeds GitHub's file size limit of 100.00 MB
好的,所以我决定使用lfs:

brew install git-lfs
git lfs install
现在,在尝试跟踪我的大文件时:

git lfs track "*.conf"
我得到了这个错误:

This operation must be run in a work tree.

我怎样才能解决这个问题呢?

我讨厌回答我自己的问题,但这对我来说很有用:

brew install bfs
bfg --convert-to-git-lfs '*.{conf,log}' --no-blob-protection new-bare.git
cd new-bare.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push origin master

克隆你的裸体回购。签出的文件称为工作树。如何?git clone new-bare.git向我发出警告:远程头引用了不存在的ref,无法签出,生成的克隆为空。在new-bare.git中,您可以键入git branch以查看存在哪些分支。然后你可以做git clone-branch new-bare.git.Hmm,现在我得到了:emote origin不支持LFS锁定API…所有东西都是最新的,但是GitHub repo仍然是空的:在你有东西存储在其中之前,你不能使用GitHub repo。首先使用从svn创建的原始裸克隆创建GitHub可以接受的新存储库。当然,你也可以使用一种不设置这些限制的服务,据我所知,这是不可能的。