Git 推送失败(LFS 上传丢失的对象)
Git failed to push (LFS upload missing objects)
我已经将 Gitlab 与 LFS 一起使用了一段时间,但不知何故 运行 今天遇到了这个问题:
me@some-PC MINGW32 /b/Unity Projects/Platballer (master)
$ git push
LFS upload missing objects: (32/33), 30 MB | 0 B/s
Uploading LFS objects: 97% (32/33), 30 MB | 0 B/s, done
(missing) Assets/External Assets/TimelineEvents/setup-guide.pdf (6ef8ef61e49821309de416925bf4e068ebb10a57f3398cb926e967eeb90cf034)
Counting objects: 401, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (400/400), done.
Writing objects: 100% (401/401), 1.40 MiB | 9.56 MiB/s, done.
Total 401 (delta 177), reused 0 (delta 0)
remote: Resolving deltas: 100% (177/177), completed with 31 local objects.
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".
To arvzrg.asuscomm.com:arvz/platballer.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@link.someurlcom:me/project.git'
所以我照他们说的做了 运行 git lfs push --all origin master
这给了我:
Uploading LFS objects: 100% (330/331), 52 MB | 0 B/s, done
LFS upload missing objects:
(missing) Assets/External Assets/TimelineEvents/setup-guide.pdf (6ef8ef61e49821309de416925bf4e068ebb10a57f3398cb926e967eeb90cf034)
好像该做的都做了,对吧?所以我再次尝试推动,但我仍然遇到与之前完全相同的问题。
我 运行 我自己在网络上的服务器上安装了 GitLab。
我还能在这里做什么?
检查这是否类似于 gitlab-org/gitlab-ce issue 40616:
I've verified that it is possible to push to GitLab if the LFS objects are stored elsewhere, but LFS must be disabled for the project so that the LFS validation is disabled.
Disabled LFS for the project using the API (I'm using HTTPie)
http PUT https://gitlab.com/api/v4/projects/<id> name=<project-name> lfs_enabled=false Private-Token:<your token>
Add the lfs.url
to the lfs config (for example GitHub)
git config -f .lfsconfig lfs.url https://github.com/<user>/<project>.git/info/lfs
Push to GitLab should now work
我已经将 Gitlab 与 LFS 一起使用了一段时间,但不知何故 运行 今天遇到了这个问题:
me@some-PC MINGW32 /b/Unity Projects/Platballer (master)
$ git push
LFS upload missing objects: (32/33), 30 MB | 0 B/s
Uploading LFS objects: 97% (32/33), 30 MB | 0 B/s, done
(missing) Assets/External Assets/TimelineEvents/setup-guide.pdf (6ef8ef61e49821309de416925bf4e068ebb10a57f3398cb926e967eeb90cf034)
Counting objects: 401, done.
Delta compression using up to 16 threads.
Compressing objects: 100% (400/400), done.
Writing objects: 100% (401/401), 1.40 MiB | 9.56 MiB/s, done.
Total 401 (delta 177), reused 0 (delta 0)
remote: Resolving deltas: 100% (177/177), completed with 31 local objects.
remote: GitLab: LFS objects are missing. Ensure LFS is properly set up or try a manual "git lfs push --all".
To arvzrg.asuscomm.com:arvz/platballer.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@link.someurlcom:me/project.git'
所以我照他们说的做了 运行 git lfs push --all origin master 这给了我:
Uploading LFS objects: 100% (330/331), 52 MB | 0 B/s, done
LFS upload missing objects:
(missing) Assets/External Assets/TimelineEvents/setup-guide.pdf (6ef8ef61e49821309de416925bf4e068ebb10a57f3398cb926e967eeb90cf034)
好像该做的都做了,对吧?所以我再次尝试推动,但我仍然遇到与之前完全相同的问题。
我 运行 我自己在网络上的服务器上安装了 GitLab。
我还能在这里做什么?
检查这是否类似于 gitlab-org/gitlab-ce issue 40616:
I've verified that it is possible to push to GitLab if the LFS objects are stored elsewhere, but LFS must be disabled for the project so that the LFS validation is disabled.
Disabled LFS for the project using the API (I'm using HTTPie)
http PUT https://gitlab.com/api/v4/projects/<id> name=<project-name> lfs_enabled=false Private-Token:<your token>
Add the
lfs.url
to the lfs config (for example GitHub)git config -f .lfsconfig lfs.url https://github.com/<user>/<project>.git/info/lfs
Push to GitLab should now work