Reputation: 310
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?
Upvotes: 0
Views: 599
Reputation: 310
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.
Upvotes: 0