Git LFS文件未推送到远程仓库

问题描述 投票:1回答:1

我正在尝试使用git LFS将xlsx文件推送到远程存储库。

我已经尝试了两种方法:使用Sourcetree单击菜单和使用终端服务器。两者都导致相同的错误消息。

我在Bitbucket中设置了一个远程仓库,并设置了允许LFS选项。我将空仓库克隆到本地文件位置。

在Sourcetree中,我使用了Repository / Git LFS / Initizalise存储库。这给了我一个点击菜单来设置gitattributes文件,我将其设置为允许xlsx文件(* .xlsx)。我提交并推送了自动创建的gitattributes文件。然后,我将Excel文件移到本地文件夹中,提交并尝试推送。

[在终端窗口中,我使用了几乎相同的方法-克隆空的远程存储库,然后执行git lfs install,git lfs track“ * .xlsx”,提交并推送gitattributes文件,然后添加并提交Excel文件。

[当我尝试推入Sourcetree或使用终端时,收到相同的错误消息:

Uploading LFS objects:   0% (0/1), 0 B | 0 B/s, done
Fatal error: null
error: failed to push some refs to 'remote_repo_location'


git clone remote_repo
cd remote_repo
git init
git lfs install
git lfs track "*.xlsx"
git add -A
git commit -m "test"
git push origin master 

(this works fine and puts the gitattributes file in my remote repo)

Then I physically copy the Excel file into the folder and do this:
git add -A
git commit -m "test2"
git push origin master

这将导致错误消息

git atlassian-sourcetree bitbucket-server git-lfs
1个回答
0
投票
  • 我为解决问题而采取的步骤:

1-查看状态

git lfs状态

2-获取所有对象

git lfs fetch --all

3-允许不完全推送,默认为“ false”

git config --global lfs.allowincompletepush true

4- Git push-全部以某种方式强制推动

git lfs push --all origin master

4-如果您以某种方式拥有未拉出的数据,则可能要:

git lfs拉git push

5-如果没有任何效果,请尝试:

git push -f --no-verify

不要同时使用VPN或代理

© www.soinside.com 2019 - 2024. All rights reserved.