2016-11-02 7 views
1

내가 파일을 저장하기 위해 LFS를 사용하는 원격에서 분기를 체크 아웃하려고 해요 :자식-LFS 체크 아웃 원격 지사

git remote add remoteRepo [email protected]: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= 

자식은-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) 
    [email protected]:username/repo.git 
Endpoint (remoterepo)=https://github.com/username/remoteRepo.git/info/lfs (auth=none) 
    [email protected]: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 [email protected]:user/remoteRepo-lfs.git 

및 성공적으로 .lfsconfig 파일에 지정하여 분기를 체크 아웃 할 수 있었다 :

기원에 대한 엔드 포인트 URL을 덮어 쓸 것
[lfs] 
    url = https://github.com/username/remoteRepo-lfs.git 
[remote "remoteRepo"] 
    lfsurl = https://github.com/username/remoteRepo-lfs.git/info/lfs 

. 로컬 디렉토리를 설정하는 방법이 있나요?/pull/checkout lfs 파일을 원점과 원격 위치에서 해당 엔드 포인트 URL을 기반으로 푸시/풀/푸시 할 수 있습니까?

+0

"git checkout -b test remoteRepo/master"명령에서 "test"란 무엇입니까? –

+0

이는 remoteRepo/master 브랜치를 추적하는 로컬 브랜치의 이름입니다. – zhanga

+0

당신이 그것을 당길 경우 발생합니까? –

답변

1

lfs 필터 (~/.gitconfig에 있음). 즉 :

[filter "lfs"] 
    smudge = git-lfs smudge --skip %f 
    required = true 
    clean = git-lfs clean -- %f 

git-lfs는 파일 포인터를 실제 파일로 smudge 변환합니다. 이 해결 방법으로, 나는/검색 파일의 내용을 액세스 할 수

git lfs checkout 

다음에

git lfs fetch 

을 수행해야합니다. 이 해결 방법이 필요한 이유는 분명하지 않습니다. git-lfs의 문제를 살펴보면이 작업이 진행중인 것처럼 보입니다.

(예 : https://github.com/github/git-lfs/issues/834).

+0

이 문제에 대한 좋은 해결 방법을 찾았으므로 답변으로 표시 하시겠습니까? 그래서 그것은 같은 문제를 만난 다른 회원을 도울 것입니다. –

0

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 repo를 만드셨습니까? 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 
+0

"git-lfs env"명령이 제대로 작동하지 않기 때문에 git-lfs가 설치되었습니다. 나는 디폴트 lfs 서버가 존재하는 repo 자체라는 인상을 받고있었습니다. 내 로컬 디렉토리에 관해서는, 나는 우분투 14.04 LTS에있다. 귀하의 디렉토리가 Windows 시스템을 나타내는 것 같습니다? – zhanga