我试图从远程签出一个使用lfs存储文件的分支:
git remote add remoteRepo git@github.com:user/remoteRepo-lfs.git
git fetch remoteRepo
git checkout -b test remoteRepo/master
值得一提的是,远程程序一直受制于bozaro/git-lfs-迁移工具。签出过程因出现错误而停止,而
git lfs logs last
显示:
git-lfs/1.4.4 (GitHub; linux amd64; go 1.7.3; git cbf91a9)
git version 2.10.2
$ git-lfs smudge -- testText.log
Error downloading object: testText.log (dc56c0fc4d655b0895d83cd61b121f30cb74bda428655db4144e4a1c8b582b57)
Smudge error: Error buffering media file: Object not found on the server.:
github.com/github/git-lfs/errors.newWrappedError
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/errors/types.go:166
github.com/github/git-lfs/errors.NewSmudgeError
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/errors/types.go:252
github.com/github/git-lfs/lfs.PointerSmudge
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/lfs/pointer_smudge.go:69
github.com/github/git-lfs/lfs.(*Pointer).Smudge
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/lfs/pointer.go:64
github.com/github/git-lfs/commands.smudgeCommand
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/commands/command_smudge.go:66
github.com/github/git-lfs/vendor/github.com/spf13/cobra.(*Command).execute
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/vendor/github.com/spf13/cobra/command.go:477
github.com/github/git-lfs/vendor/github.com/spf13/cobra.(*Command).Execute
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/vendor/github.com/spf13/cobra/command.go:551
github.com/github/git-lfs/commands.Run
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/commands/run.go:65
main.main
/Users/ttaylorr/dev/go/src/github.com/github/git-lfs/git-lfs.go:33
runtime.main
/usr/local/Cellar/go/1.7.3/libexec/src/runtime/proc.go:183
runtime.goexit
/usr/local/Cellar/go/1.7.3/libexec/src/runtime/asm_amd64.s:2086
ENV:
LocalWorkingDir=/home/person/Projects/proteus/proteus
LocalGitDir=/home/person/Projects/proteus/proteus/.git
LocalGitStorageDir=/home/person/Projects/proteus/proteus/.git
LocalMediaDir=/home/person/Projects/proteus/proteus/.git/lfs/objects
LocalReferenceDir=
TempDir=/home/person/Projects/proteus/proteus/.git/lfs/tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
BatchTransfer=true
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic
UploadTransfers=basic
GIT_DIR=.git
GIT_PREFIX=
git-lfs env显示:
git-lfs/1.4.4 (GitHub; linux amd64; go 1.7.3; git cbf91a9)
git version 2.10.2
Endpoint=https://github.com/username/repo.git/info/lfs (auth=none)
SSH=git@github.com:username/repo.git
Endpoint (remoterepo)=https://github.com/username/remoteRepo.git/info/lfs (auth=none)
SSH=git@github.com:username/remoteRepo.git
LocalWorkingDir=/home/person/Projects/proteus/proteus
LocalGitDir=/home/person/Projects/proteus/proteus/.git
LocalGitStorageDir=/home/person/Projects/proteus/proteus/.git
LocalMediaDir=/home/person/Projects/proteus/proteus/.git/lfs/objects
LocalReferenceDir=
TempDir=/home/person/Projects/proteus/proteus/.git/lfs/tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
BatchTransfer=true
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic
UploadTransfers=basic
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
我已经成功地克隆了远程回购-lfs
git clone git@github.com:user/remoteRepo-lfs.git
还可以通过在.lfsconfig文件中指定以下内容成功地签出分支:
[lfs]
url = https://github.com/username/remoteRepo-lfs.git
[remote "remoteRepo"]
lfsurl = https://github.com/username/remoteRepo-lfs.git/info/lfs
它似乎覆盖了原点的端点url。是否有一种方法来设置本地目录,使我可以推送/拉出/签出lfs文件的原点和远程基于它们各自的端点urls?
发布于 2016-11-09 16:25:54
通过修改lfs过滤器(in ~/..gitconfig),我找到了解决这个问题的方法。即:
[filter "lfs"]
smudge = git-lfs smudge --skip %f
required = true
clean = git-lfs clean -- %f
git-lfs污迹将文件指针转换为实际文件。有了这个解决办法,我必须执行一个
git lfs fetch
后面跟着一个
git lfs checkout
检索/访问文件的内容。我不清楚为什么这个解决办法是必要的。纵观git-lfs上的问题,这似乎是一项正在进行的一般性工作。
发布于 2016-11-04 05:42:02
你安装过git-lfs吗?如果没有,您可以安装这里。您似乎还没有GIT_LFS_PATH,可以参考我自己的环境。
DownloadTransfers=basic
UploadTransfers=basic
GIT_LFS_PATH=C:\Program Files\Git LFS
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
您是否在GitHub上创建了GitHub回购?您可以尝试使用https://github.com/username/remoteRepo-lfs.git来检查它是否真的存在。
我也对您的本地目录感到困惑,比如:
LocalWorkingDir=/home/person/Projects/proteus/proteus
LocalGitDir=/home/person/Projects/proteus/proteus/.git
LocalGitStorageDir=/home/person/Projects/proteus/proteus/.git
LocalMediaDir=/home/person/Projects/proteus/proteus/.git/lfs/objects
LocalReferenceDir=
TempDir=/home/person/Projects/proteus/proteus/.git/lfs/tmp
我的本地目录如下:
LocalWorkingDir=C:\Users\TFSTest\New folder\Git2
LocalGitDir=C:\Users\TFSTest\New folder\Git2\.git
LocalGitStorageDir=C:\Users\TFSTest\New folder\Git2\.git
LocalMediaDir=C:\Users\TFSTest\New folder\Git2\.git\lfs\objects
LocalReferenceDir=
TempDir=C:\Users\TFSTest\New folder\Git2\.git\lfs\tmp
https://stackoverflow.com/questions/40387376
复制相似问题