git lfs 迁移信息输出 Git 无法解析引用:“HEAD”

发布于 2025-01-10 14:27:28 字数 2889 浏览 0 评论 0原文

我正在尝试将 git 存储库迁移到 Git LFS。我已经使用 git lfs install 安装了 Git LFS。但是当我执行 git lfs migrate info 时,我得到以下输出(启用 GIT_TRACE ):

> git lfs migrate info
13:10:41.420197 git.c:703               trace: exec: git-lfs migrate info
13:10:41.420282 run-command.c:663       trace: run_command: git-lfs migrate info
13:10:41.426809 trace git-lfs: exec: git 'version'
13:10:41.434261 trace git-lfs: exec: git 'config' '-l'
13:10:41.754159 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
Git can't resolve ref: "HEAD"

我不确定 git lfs 正在做什么,但是当我自己执行跟踪的最后一个命令时,它似乎有效:

> git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
13:14:35.705088 git.c:439               trace: built-in: git rev-parse HEAD --symbolic-full-name HEAD
453332128e48ab30cb60cd06e334c76b0571dd76
refs/heads/main

我的 Git-LFS 设置如下:

> git lfs env
13:15:36.500676 git.c:703               trace: exec: git-lfs env
13:15:36.500746 run-command.c:663       trace: run_command: git-lfs env
13:15:36.506168 trace git-lfs: exec: git 'version'
git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.5)
git version 2.25.1

13:15:36.508870 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
13:15:36.520625 trace git-lfs: exec: git 'config' '-l'
Endpoint (bitbucket)=https://***CENSORED***.git/info/lfs (auth=none)
LocalWorkingDir=/some/path/MyGitRepo
LocalGitDir=/some/path/MyGitRepo/.git
LocalGitStorageDir=/some/path/MyGitRepo/.git
LocalMediaDir=/some/path/MyGitRepo/.git/lfs/objects
LocalReferenceDirs=
TempDir=/some/path/MyGitRepo/.git/lfs/tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=/some/path/MyGitRepo/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file
UploadTransfers=basic,lfs-standalone-file
GIT_CURL_VERBOSE=1
GIT_EXEC_PATH=/usr/lib/git-core
GIT_TRACE=1
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"
13:15:36.524541 trace git-lfs: filepathfilter: rewrite ".git" as "**/.git/**"
13:15:36.524562 trace git-lfs: filepathfilter: rewrite "**/.git" as "**/.git"
13:15:36.524731 trace git-lfs: filepathfilter: accepting "tmp"

我应该提到,我还没有将存储库推送到服务器,因为我首先想迁移到 Git-LFS。有谁知道问题可能出在哪里?

I'm trying to migrate a git repository to Git LFS. I already installed Git LFS with git lfs install. But when I'm executing git lfs migrate info I get the following output (with GIT_TRACE enabled):

> git lfs migrate info
13:10:41.420197 git.c:703               trace: exec: git-lfs migrate info
13:10:41.420282 run-command.c:663       trace: run_command: git-lfs migrate info
13:10:41.426809 trace git-lfs: exec: git 'version'
13:10:41.434261 trace git-lfs: exec: git 'config' '-l'
13:10:41.754159 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
Git can't resolve ref: "HEAD"

I'm not sure what git lfs is doeing but when I execute the last command of the trace myself it seems to work:

> git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
13:14:35.705088 git.c:439               trace: built-in: git rev-parse HEAD --symbolic-full-name HEAD
453332128e48ab30cb60cd06e334c76b0571dd76
refs/heads/main

My Git-LFS setup is following:

> git lfs env
13:15:36.500676 git.c:703               trace: exec: git-lfs env
13:15:36.500746 run-command.c:663       trace: run_command: git-lfs env
13:15:36.506168 trace git-lfs: exec: git 'version'
git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.5)
git version 2.25.1

13:15:36.508870 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
13:15:36.520625 trace git-lfs: exec: git 'config' '-l'
Endpoint (bitbucket)=https://***CENSORED***.git/info/lfs (auth=none)
LocalWorkingDir=/some/path/MyGitRepo
LocalGitDir=/some/path/MyGitRepo/.git
LocalGitStorageDir=/some/path/MyGitRepo/.git
LocalMediaDir=/some/path/MyGitRepo/.git/lfs/objects
LocalReferenceDirs=
TempDir=/some/path/MyGitRepo/.git/lfs/tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=/some/path/MyGitRepo/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file
UploadTransfers=basic,lfs-standalone-file
GIT_CURL_VERBOSE=1
GIT_EXEC_PATH=/usr/lib/git-core
GIT_TRACE=1
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"
13:15:36.524541 trace git-lfs: filepathfilter: rewrite ".git" as "**/.git/**"
13:15:36.524562 trace git-lfs: filepathfilter: rewrite "**/.git" as "**/.git"
13:15:36.524731 trace git-lfs: filepathfilter: accepting "tmp"

I should mention that I did not push the repository yet to the server as I first wanted to migrat e to Git-LFS. Has anyone an idea where the issue could be?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

诗笺 2025-01-17 14:27:28

没有真正的解决方案,但是:

问题中使用的 git-lfs 版本是 2.9.2,它是通过 ubunut 上的 apt 安装的 apt install git-lfs 。使用最新版本 3.1.2(从 https://git-lfs.github.com/ 安装)确实为我解决了这个问题。

No real solution but:

The version of git-lfs used in the question was 2.9.2 which was installed via apt on ubunut apt install git-lfs. Using the latest version 3.1.2 (installed from https://git-lfs.github.com/) does fix the issue for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文