Git推送失败(LFS上传丢失的对象)

时间:2018-09-20 12:09:38

标签: git version-control gitlab atlassian-sourcetree git-lfs

我已经在LFS上使用Gitlab了好一阵子,但今天却以某种方式遇到了这个问题:

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安装。

我还能在这里做什么?

1 个答案:

答案 0 :(得分:2)

检查是否类似于gitlab-org/gitlab-ce issue 40616

  

我已经证实,如果LFS对象存储在其他位置,则可以推送到GitLab,但是必须为项目禁用LFS,以便禁用LFS验证。

     

使用API​​的项目禁用了LFS(我使用的是HTTPie)

     

http PUT https://gitlab.com/api/v4/projects/ name = lfs_enabled = false私有令牌:

     

const swalButton = document.getElementById('sweet-alert-demo'), form = document.querySelector('form'); function bindSweetAlertButtonDemo() { if (swalButton) { // protect other pages swalButton.addEventListener('click', (event) => { swal({ title: "Nice", text: "You've added a task. Click on it for more details", icon: "success" }).then(function(value){ if(value!=null){ form.submit(); } }); event.preventDefault(); }); } } bindSweetAlertButtonDemo();添加到lfs配置(例如GitHub)

<script src="https://unpkg.com/sweetalert@2.1.0/dist/sweetalert.min.js"></script>
<div>
<form>
<input type="text" name="name" placeholder="Name"><br/>
<input type="description" name="description" placeholder="Description"><br/>
<button id="sweet-alert-demo">Submit</button>
</form>
</div>
     

推送到GitLab现在应该可以工作