Can`t push Git LFS repository to google cloud server

289 views Asked by At

I have a repository configured as a LFS git having a .gitattibute.

I have followed this tutorial

  1. I have created a remote repo using gcloud source repos create myTestLFS
  2. Have cloned using gcloud source repos clone myTestLFS
  3. Changed to myTestLFS dir and installed lfs: git lfs install
  4. Created a .gitattribute file with the content *.kra filter=lfs diff=lfs merge=lfs -text
  5. Added and commited and pushed the .gitattibute file to remote, it works but gives the message
Remote "origin" does not support the Git LFS locking API. Consider disabling it with:
  $ git config lfs.https://source.developers.google.com/p/my-project-id/r/myTestLFS.git/info/lfs.locksverify false
  1. Created a file acrow.kra
  2. added and commited. But when I try to push, it gives this error message:
Uploading LFS objects:   0% (0/101), 0 B | 0 B/s, done.
batch response: Client error &{%!!(string=https) %!!(string=) %!!(*url.Userinfo=<nil>) %!!(string=source.cloud.google.com) %!!(string=/onboarding/welcome) %!!(stri
ng=) %!!(bool=false) %!!(bool=false) %!!(string=) %!!(string=) %!!(string=)}s(MISSING) from HTTP 405
error: failed to push some refs to 'https://source.developers.google.com/p/my-project-id/r/myTestLFS'

I'm on windows

1

There are 1 answers

1
Sandeep Vokkareni On

I tried the same steps you mentioned in my cloud shell instance. It seems that maybe you have missed to install the lfs properly or you missed to run the command git config lfs.https://source.developers.google.com/p/project_ID/r/myTestLFS.git/info/lfs.locksverify false which is suggested in the error message you have shared. For your reference I have shared detailed steps which I have followed. I hope this helps in solving your issue.

  1. created a remote repo using gcloud source repos create myTestLFS

  2. Cloned the repo using the command gcloud source repos clone myTestLFS

  3. Switched to directory to myTestLFS and executed git lfs install, but got some error. Then I ran the command sudo apt-get install git-lfs to install lfs and successfully executed git lfs install after that without any error.

  4. Created the .gitattribute file with the content \*.kra filter=lfs diff=lfs merge=lfs -text

  5. Committed .gitattribute file successfully. But when I try to push I have also got the similar error as yours:

Remote "origin" does not support the LFS locking API. Consider disabling it with:   
$ git config lfs.https://source.developers.google.com/p/project_ID/r/myTestLFS.git/info/lfs.locksverify false
  1. To overcome above executed the command git config lfs.https://source.developers.google.com/p/project_ID/r/myTestLFS.git/info/lfs.locksverify false

  2. At last I created a new file (acrow.kra) with some random plain text , It got pushed successfully without any errors.