How to get git lfs files (original files not file pointers) from download as source code.zip from tags or releases?

戏子无情 提交于 2020-01-04 02:57:13

问题


When I tag the commit then I download from github.com/user/project/releases all LFS file is not coming (original files) but only the file pointers (around 1kb per file)

I tried to call "git lfs fetch" is absolute doesn't work because '.git' folder is not coming with the zip

$ git lfs fetch
Not in a git repository.

When I download the tag through the github.com/user/project/releases it should be the all original file from that tag.

Did I miss something? I tried to search at Google but not found my question.


回答1:


GitHub doesn't provide a way to get the LFS files using the downloadable archives. Some projects include their own tarballs that contains the LFS files, and if so, you can use one of those tarballs.

Otherwise, you can do something like the following to get the LFS files (in this case, for example/project at v1.0.0):

git clone -b v1.0.0 --depth 1 https://github.com/example/project.git project
git -C project archive --format=zip --prefix=project-1.0.0/ HEAD >project-1.0.0.zip

Note that if you're trying to download multiple archives, it will be better to clone the entire repo instead of using a shallow clone as I did above.



来源:https://stackoverflow.com/questions/57443162/how-to-get-git-lfs-files-original-files-not-file-pointers-from-download-as-sou

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!