简体   繁体   中英

Git LFS files not pushing to remote repo

I'm trying to push an xlsx file to a remote repository using git LFS.

I've tried two ways: Using Sourcetree click-thru menus and using the terminal server. Both result in the same error message.

I set up a remote repo in Bitbucket and set the Allow LFS option. I cloned the empty repo to a local file location.

In Sourcetree, I used Repository/Git LFS/Initizalise repo. This gave me a click-thru menu to set up a gitattributes file, which I set to allow xlsx files (*.xlsx) . I committed and pushed the gitattributes file which was automatically created. Then I moved the Excel file into the local folder, committed, and tried to push.

In the terminal window, I used much the same approach--cloning the empty remote repo, then doing git lfs install, git lfs track "*.xlsx", committing and pushing the gitattributes file, and then adding and committing the Excel file.

When I tried to push in either Sourcetree or using the terminal, I got the same error message:

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

This causes the error message

  • Steps I produced to solve the problem:

1- View the status

git lfs status

2- Fetch all objects

git lfs fetch --all

3- Allowing incomplete push, It is "false" by default

git config --global lfs.allowincompletepush true

4- Git push -all to somehow forces the push

git lfs push --all origin master

4- If somehow you have un-pulled data you might want to:

git lfs pull git push

5- If nothing works, just try:

git push -f --no-verify

DO NOT PUSH ON A VPN NOR A PROXY

I hit this problem with BitBucket, and the solution was

git config --global lfs.contenttype 0

I got the idea from this thread .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM