git-lfs 检出远程分支
git-lfs checkout remote branch
我正在尝试从使用 lfs 存储文件的远程检查分支:
git remote add remoteRepo git@github.com:user/remoteRepo-lfs.git
git fetch remoteRepo
git checkout -b test remoteRepo/master
值得一提的是,远程已经受制于bozaro/git-lfs-migrate工具。结帐过程因错误和
而停止
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=
A 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"
我已经用
成功克隆了 remoteRepo-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。有没有一种方法可以设置本地目录,以便我可以 push/pull/checkout 根据各自的端点 urls 来自源和远程的 lfs 文件?
你安装过 git-lfs 吗?如果没有,你可以安装here。好像你还没有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 上创建了 git-lfs 存储库?你可以尝试使用 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
我通过修改 lfs 过滤器(在 ~/.gitconfig 中)找到了解决我遇到的这个问题的方法。即:
[filter "lfs"]
smudge = git-lfs smudge --skip %f
required = true
clean = git-lfs clean -- %f
git-lfs smudge 将文件指针转换为实际文件。使用此解决方法,我必须执行
git lfs fetch
后跟
git lfs checkout
到retrieve/access文件的内容。我不清楚为什么需要这种解决方法。查看 git-lfs 上的问题,这似乎是一项正在进行的一般工作。
我正在尝试从使用 lfs 存储文件的远程检查分支:
git remote add remoteRepo git@github.com:user/remoteRepo-lfs.git
git fetch remoteRepo
git checkout -b test remoteRepo/master
值得一提的是,远程已经受制于bozaro/git-lfs-migrate工具。结帐过程因错误和
而停止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=
A 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"
我已经用
成功克隆了 remoteRepo-lfsgit 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。有没有一种方法可以设置本地目录,以便我可以 push/pull/checkout 根据各自的端点 urls 来自源和远程的 lfs 文件?
你安装过 git-lfs 吗?如果没有,你可以安装here。好像你还没有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 上创建了 git-lfs 存储库?你可以尝试使用 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
我通过修改 lfs 过滤器(在 ~/.gitconfig 中)找到了解决我遇到的这个问题的方法。即:
[filter "lfs"]
smudge = git-lfs smudge --skip %f
required = true
clean = git-lfs clean -- %f
git-lfs smudge 将文件指针转换为实际文件。使用此解决方法,我必须执行
git lfs fetch
后跟
git lfs checkout
到retrieve/access文件的内容。我不清楚为什么需要这种解决方法。查看 git-lfs 上的问题,这似乎是一项正在进行的一般工作。