Open zhuxianzhiniko opened 6 years ago
Have you set Base URL? Hmm, GitBucket wiki might lack this requirement...
Very old question and i think still not documented in the docu. In the wiki there is a hint on the performance page:
gitbucket$ grep -Hnri lfs . --include="*md" ./CHANGELOG.md:320:- GitLFS support ./README.md:18:- GitLFS support ./doc/directory.md:19: * /lfs (LFS managed files)
And in the wiki:
gitbucket.wiki$ grep -Hnri lfs . --include="*md" ./Performance.md:13: - for (big) binary files in repos, activate the Git-LFS functionality: http://gitbucket.github.io/gitbucket-news/gitbucket/2017/01/03/git-lfs-support.html
https://github.com/gitbucket/gitbucket/wiki/Performance that points to a blogpost https://gitbucket.github.io/gitbucket-news/gitbucket/2017/01/03/git-lfs-support.html
That points to a branch that does not exist anymore --> https://github.com/gitbucket/gitbucket/tree/git-lfs-support
LFS works not out of the box, so you have to configure it somewhere -->
$ mkdir lfstest && cd lfstest && git init && wget -O test.png https://avatars.githubusercontent.com/u/1094760?v=4 && git lfs track "*.png" && git add . && git commit -m "TEST" && git remote add origin ssh://git@erde:18889/bernd/lfstest.git && git push -u origin main
Initialized empty Git repository in /home/bernd/workspace/gitbucket/lfstest/.git/
--2024-05-19 10:03:57-- https://avatars.githubusercontent.com/u/1094760?v=4
Resolving avatars.githubusercontent.com (avatars.githubusercontent.com)... 185.199.110.133, 185.199.109.133, 185.199.108.133, ...
Connecting to avatars.githubusercontent.com (avatars.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 72435 (71K) [image/png]
Saving to: ‘test.png’
test.png 100%[==========================================================================================================>] 70.74K --.-KB/s in 0.03s
2024-05-19 10:03:57 (2.56 MB/s) - ‘test.png’ saved [72435/72435]
Tracking "*.png"
[main (root-commit) cea04b2] TEST
2 files changed, 4 insertions(+)
create mode 100644 .gitattributes
create mode 100644 test.png
Remote "origin" does not support the Git LFS locking API. Consider disabling it with:
$ git config lfs.https://erde/bernd/lfstest.git/info/lfs.locksverify false
batch request: Unknown command: git-lfs-authenticate /bernd/lfstest.git upload: exit status 1
error: failed to push some refs to 'ssh://erde:18889/bernd/lfstest.git'
It seems lfs works with http out of the box without any special configuration:
$ mkdir lfsHttpTest && cd lfsHttpTest && git init && wget -O test.png https://avatars.githubusercontent.com/u/1094760?v=4 && git lfs track "*.png" && git add . && git commit -m "TEST" && git remote add origin http://erde:18888/git/bernd/lfsHttpTest.git && git push -u origin main
Initialized empty Git repository in /home/bernd/workspace/gitbucket/lfsHttpTest/.git/
--2024-05-19 10:39:30-- https://avatars.githubusercontent.com/u/1094760?v=4
Resolving avatars.githubusercontent.com (avatars.githubusercontent.com)... 185.199.109.133, 185.199.111.133, 185.199.108.133, ...
Connecting to avatars.githubusercontent.com (avatars.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 72435 (71K) [image/png]
Saving to: ‘test.png’
test.png 100%[==========================================================================================================>] 70.74K --.-KB/s in 0.02s
2024-05-19 10:39:30 (3.08 MB/s) - ‘test.png’ saved [72435/72435]
Tracking "*.png"
[main (root-commit) 2c8f5f8] TEST
2 files changed, 4 insertions(+)
create mode 100644 .gitattributes
create mode 100644 test.png
Username for 'http://erde:18888': bernd
Password for 'http://bernd@erde:18888':
Uploading LFS objects: 100% (1/1), 72 KB | 0 B/s, done.
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 6 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 406 bytes | 203.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Updating references: 100% (1/1)
To http://erde:18888/git/bernd/lfsHttpTest.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
So either we miss here documentation for lfs+ssh or it is a bug.
Git works fine. Use lfs push to receive the error:
Git LFS: (0 of 80 files) 0 B / 19.03 MB batch response: Repository or object not found: http://myserver:8080/root/Test Check that it exists and that you have proper access to it error: failed to push some refs to 'http://myserver:8080/git/root/Test.git'
.git/config: [lfs "http://myserver:8080/git/root/Test.git/info/lfs"] access = basic locksverify = false