git lfs的安装和使用详细案例
#------------------------------------- 下面是安裝部分-------------------------------------------------
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
apt-get install -y --allow-unauthenticated git-lfs
#------------------------------------- 下面是上傳部分-------------------------------------------------
然后普通用戶下:
git lfs install
?
找個100MB以上的大文件Adobe_Premiere_Pro_CC.7z.
?
(python3.6) appleyuchi@ubuntu:RSNA_MODEL$ git lfs track "*.7z"
Tracking "*.zip"
(python3.6) appleyuchi@ubuntu:RSNA_MODEL$ git add .gitattributes
(python3.6) appleyuchi@ubuntu:RSNA_MODEL$ git add Adobe_Premiere_Pro_CC.7z?
(python3.6) appleyuchi@ubuntu:RSNA_MODEL$?
(python3.6) appleyuchi@ubuntu:RSNA_MODEL$ git commit -m "Add design file"
[master (root-commit) 2ed950e] Add design file
?2 files changed, 1 insertion(+)
?create mode 100644 .gitattributes
?create mode 100755 Adobe_Premiere_Pro_CC.7z
(python3.6) appleyuchi@ubuntu:RSNA_MODEL$ git push origin master
Locking support detected on remote "origin". Consider enabling it with:
? $ git config lfs.https://git.coding.net/appleyuchi/RSNA_MODEL.git/info/lfs.locksverify true
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 160.32 MiB | 1.31 MiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To https://git.coding.net/appleyuchi/RSNA_MODEL.git
?* [new branch] ? ? ?master -> master
#------------------------------------- 下面是clone-------------------------------------------------
(python3.6) appleyuchi@ubuntu:RSNA_MODEL$ git clone https://coding.net/u/appleyuchi/p/RSNA_MODEL
Cloning into 'RSNA_MODEL'...
warning: redirecting to https://git.coding.net/u/appleyuchi/p/RSNA_MODEL/
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (3/3), done.
Unpacking objects: ?75% (3/4) ??
remote: Total 4 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (4/4), done.
?
最后會發(fā)現(xiàn)文件被順利下載了。
目前已經(jīng)405了
用法參考[1],似乎現(xiàn)在只有付費(fèi)的用戶才支持了。
#----------------------------------------------------------------------------------------------
補(bǔ)充:
上述方法在github通過,
coding經(jīng)過上面的測試,已經(jīng)變成付費(fèi)的了。
gitee根據(jù)[2]中開發(fā)人員的回復(fù),目前只能是付費(fèi)企業(yè)才支持lfs
Reference:
[1]https://coding.net/git/lfs
[2]https://gitee.com/oschina/git-osc/issues/ILIZL?from=project-issue
?
總結(jié)
以上是生活随笔為你收集整理的git lfs的安装和使用详细案例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: subprocess中执行git命令报告
- 下一篇: 获取python工程下面的所需的所有开源