GIT只拉动项目文件而不拉动LFS模块

时间:2017-05-09 08:51:55

标签: git bitbucket git-lfs

我有一个bitbucket项目,它也有一个集成的LFS模块。我已经确认预期在LFS模块中的文件存在于LFS模块本身中,而不是在主项目中。

但是当我克隆项目时,这就是正在发生的事情:

Cloning into 'testing'...
remote: Counting objects: 310, done.
remote: Compressing objects: 100% (164/164), done.
remote: Total 310 (delta 124), reused 219 (delta 104)
Receiving objects: 100% (310/310), 25.57 MiB | 846.00 KiB/s, done.
Resolving deltas: 100% (124/124), done.
Checking connectivity... done.
Downloading xxx1.file (60.16 MB)
Downloading xxx2.file (61.16 MB)
Downloading xxx3.file (62.16 MB)
Downloading xxx4.file (63.16 MB)

使用' git clone' LFS文件也会一起下载。命令。如果我试图突然停止下载,那么git repo中的大多数文件都会在本地被删除并显示在' git status':

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    deleted:    .gitattributes
    deleted:    .gitignore

如何避免&#39; git lfs pull&#39;发生时,使用&#39; git clone&#39;命令?

GIT LFS ENV:

git-lfs/2.1.0 (GitHub; linux amd64; go 1.8; git bd2c9987)
git version 1.9.1

Endpoint=REMOTE/info/lfs (auth=basic)
LocalWorkingDir=LOCAL
LocalGitDir=LOCAL/.git
LocalGitStorageDir=LOCAL/.git
LocalMediaDir=LOCAL/.git/lfs/objects
LocalReferenceDir=
TempDir=LOCAL/.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
AccessDownload=basic
AccessUpload=basic
DownloadTransfers=basic
UploadTransfers=basic
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"

1 个答案:

答案 0 :(得分:0)

也许这是您需要的答案(希望答案不会太晚:)):git lfs install --skip-smudge

  

-skip-smudge:跳过克隆或提取上对象的自动下载。每次在存储库中检出新提交时,都需要手动进行“ git lfs pull”操作。

more details