1. 先申請一個github賬戶。
2.選擇new repository,然後填寫相關信息
3. 點擊create repository之後,會跳轉到下面,複製該地址,待會本地上傳要用
4. 開始本地資源準備
a) cd 到文件所在的位置,然後運行
git init
b) 然後將你所要上傳的文件添加到該git中
git add filename
c) 使用下個命令查看狀態
git status
d) 然後提交文件
git commit -m ’log message‘(可以是log message,也可以是隨便什麼別的)
如果是第一次使用,那麼還需要進行身份驗證
照着做就可以了
e) 最後就是上傳了
git remote add origin https://github.com/***.git(Http of your repository)
如果之前配置過一次,再次配置則會提示以下錯誤:
ERROR:遠程 origin 已經存在。
此時只需要將遠程配置刪除,重新添加即可;git remote rm origin
f)
git push -u origin master