步驟
- 第一步:在網(wǎng)上Git平臺(tái)或者GitHub上創(chuàng)建一個(gè)項(xiàng)目。本人推薦【碼云】,拿到項(xiàng)目鏈接,比如說是:
https://gitee.com/*******/KODOrientationDemo
- 第二步:本地創(chuàng)建一個(gè)文件夾,進(jìn)入該文件夾的目錄下,然后
git init
命令執(zhí)行后會(huì)出現(xiàn)下面的截圖:

Snip20180112_45.png
- 第三步:將文件添加到此文件夾下,然后將文件從當(dāng)前工作區(qū)提交到暫存區(qū)
//這個(gè).代表的是全部所有的文件
git add .
- 第四步:將暫存區(qū)里面的內(nèi)容提交到本地倉庫git中
git commit -m "這里面就是你需要寫的說明"
- 第五步:將本地倉庫與遠(yuǎn)程倉庫建立聯(lián)系
git remote add origin https://gitee.com/*******/KODOrientationDemo
- 第六步:將本地倉庫的內(nèi)容push到遠(yuǎn)程倉庫:
git push -u origin master
問題注意
當(dāng)我們將本地的文件推送到遠(yuǎn)程倉庫的時(shí)候也就是第六步的時(shí)候,如果出現(xiàn)以下的報(bào)錯(cuò):
Counting objects: 1424, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1327/1327), done.
error: unable to rewind rpc post data - try increasing http.postBuffer
error: RPC failed; curl 56 SSLRead() return error -36
fatal: The remote end hung up unexpectedlyB | 14.00 KiB/s
Writing objects: 100% (1424/1424), 80.94 MiB | 1.88 MiB/s, done.
Total 1424 (delta 472), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
Everything up-to-date
那么就是告訴你,你的文件太大了,需要修改http傳送文件的大?。?/p>
git config http.postBuffer 524288000
然后執(zhí)行完命令后,再次進(jìn)行推送,但是會(huì)卡在下面這句話:
Total 1424 (delta 472), reused 0 (delta 0)
其實(shí)不是卡,只是你在上傳東西比較慢,等一會(huì)兒就好了。以上!!!
參考:
更全命令參考:http://blog.csdn.net/jtracydy/article/details/70402663

呆萌.png