Describe the issue cannot push to the bare repository
I'm new to git, and I don't know if my operation is right.
- create a bare repo in computer A, and install lfs, and then share the folder to the local network
- clone the bare repo to computer B and install lfs, track the files using
git lfs track "*.psd"
git add .
andgit commit -m 'lfs setup'
- make some changes to psd files
git add .
andgit commit -m 'some changes'
git push origin master
And then... ...
$ git push
Uploading LFS objects: 100% (4/4), 46 MB | 0 B/s, done.
EOF
error: failed to push some refs to '<bare repo path>'
I don’t know if there is such a way that can fix the problem?
Output of git lfs env
git lfs env in bare repo:
git-lfs/2.13.3 (GitHub; windows amd64; go 1.16.2; git a5e65851)
git version 2.31.1.windows.1
LocalWorkingDir=
LocalGitDir=<bare repo path>
LocalGitStorageDir=<bare repo path>
LocalMediaDir=<bare repo path>\lfs\objects
LocalReferenceDirs=
TempDir=<bare repo path>\lfs\tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=<bare repo path>\lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file
UploadTransfers=basic,lfs-standalone-file
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
git lfs env in the working repo (non bare):
git-lfs/2.13.3 (GitHub; windows amd64; go 1.16.2; git a5e65851)
git version 2.31.1.windows.1
Endpoint=file:///<bare repo path> (auth=none)
LocalWorkingDir=
LocalGitDir=D:\lfs-repo\.git
LocalGitStorageDir=D:\lfs-repo\.git
LocalMediaDir=D:\lfs-repo\.git\lfs\objects
LocalReferenceDirs=
TempDir=D:\lfs-repo\.git\lfs\tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=D:\lfs-repo\.git\lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file
UploadTransfers=basic,lfs-standalone-file
GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
Git LFS is an extension to Git, it is not part of git itself. It is basically a HTTP server which stores the large files, while only metadata gets pushed to the repository. The LFS server API is documented here.
If you want to work with a local bare repository, you can use lfs-test-server to be a local LFS server. It is only supposed to be used for testing purposes and is NOT PRODUCTION READY. If you need a production-ready LFS server, you should look into self-hosting a Gitlab or Gitea instance (they can be hosted on your local machine if needed).