我們在把某些文件上傳到GitHub上的時(shí)候,經(jīng)常會(huì)遇到文件過大不讓上傳的提示:Yowza, that’s a big file. Try again with a file smaller than 50MB.甚至than 25MB都不讓上傳纯赎。瞬間崩潰:“shit”荣暮。莫慌~其實(shí)Git早已準(zhǔn)備好了另一工具 Git LFS扩灯,使用如下:
首先確保你的電腦安裝了Git并且版本不低于1.8.5营搅。
1筷转、點(diǎn)擊官網(wǎng)鏈接:Git Large File Storage
2蔚万、打開終端贺待,并把圖(2)箭頭所指的 brew install git-lfs 輸入到終端
3徽曲、按照?qǐng)D(3)所示的三步驟操作(也就是官網(wǎng)原文)
舉個(gè)??:如果你想上傳一個(gè)大于100MB的 .zip 文件。1麸塞、cd到你的文件目錄秃臣,2、git lfs track "*.zip"哪工,3奥此、git add .gitattributes,4雁比、git add name.zip(name.zip是你的.zip文件名)稚虎,5、git commit -m "add name zip"偎捎,6蠢终、git push origin master。如圖(4)
第一次上傳時(shí)候還會(huì)要求輸入賬號(hào)茴她、密碼寻拂,按提示輸入就好。