git上傳本地文件(>100M)
假設(shè)GitHub上已經(jīng)有倉庫,且已經(jīng)下載好git,假設(shè)倉庫地址為
。1、首先需要下載glf,網(wǎng)址為
,2、需要在路徑下打開Git Bash Here,輸入
git init
3、在當(dāng)前路徑下同步github的代碼
git clone?https://github.com/TEST.git
4、此時(shí)本地多了一個(gè)文件夾“TEST”,將你需要添加到該倉庫的大文件copy到“TEST”文件下,跳到該大文件的下路徑,假如大文件l路徑為“*/AAA/1.exe”
cd TEST/AAA
5、
git lfs install
會(huì)顯示:
Updated git hooks.
Git LFS initialized.
6、
git lfs track?1.exe
會(huì)顯示:
Tracking "1.exe"
7、
git add .gitattributes
8、
git add 1.exe
9、
git commit -m "first commit"
first commit是注釋內(nèi)容,可以修改
會(huì)顯示:
[main 7015fc7] first commit
?3 files changed, 6 insertions(+)
?create mode 100644 .gitattributes
?create mode 100644 AAA/.gitattributes
?create mode 100644 AAA/1.exe
10、
git pull
顯示:
Already up to date.
11、
git push -u origin main
main可以修改,默認(rèn)分支為main
顯示:
Uploading LFS objects: 100% (1/1), 294 MB | 679 KB/s, done.
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 16 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 694 bytes | 694.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/TEST.git
? ?3ba4ce8..7015fc7 ?main -> main
branch 'main' set up to track 'origin/main'.
我是有一個(gè).exe文件超過了100M,先將其他文件上傳后,用上述方法對(duì).exe文件單獨(dú)上傳的,如果有更簡(jiǎn)單的方法歡迎告知,謝謝。