git lfs 迁移信息输出 Git 无法解析引用:“HEAD”
我正在尝试将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有真正的解决方案,但是:
问题中使用的 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.