git上傳原生代碼到github(最簡單方法,不用配置ssh)
阿新 • • 發佈:2019-01-07
今天幫同學上傳github程式碼時發現網上github入門教程都要配置ssh,很少有不需要配置ssh的,可是ssh配置好麻煩,這篇教程可以給不想配置ssh然後想使用github的使用者一點幫助。
第一步:建立Github新賬戶下載mygit
在github官網上註冊一個帳號 https://github.com
去網上下載mygit(git工具)
第二步:新建倉庫
進入自己github主頁,點選new,新建一個repositories,建完後可以進入這個repositories.然後複製這個https地址,後面有用。
第三步:設定帳號與郵箱 (第一次使用設定,之後可跳過此步)
在電腦任意地方右鍵調出git bush 工具,然後輸入下面命令:
git config –global user.name “your name”
git config –global user.email “your email address”
第四步:clone 剛才的https地址到本地
在本地新建一個資料夾,然後利用右鍵git bush(windows)或者cd 到當前資料夾(linux),在終端中輸入以下命令:
git clone https://github.com/th720309/123.git(右面的為你自己倉庫的地址)
第五步:新增上傳檔案
將你要上傳的project資料夾放到上一步新建的資料夾下面,之後輸入下面命令:
git add . //注意add後面有一個空格和.
第六步:commit與push
git init
git commit -m ‘stumansys’
git remote add origin https://github.com/th720309/123.git(右面的為你自己倉庫的地址)
git push origin master
輸入你的username和password,然後等待上傳就OK了。