一.純網頁版向Github上傳項目
在github下建自己的Repository。Create a New Repository如下:
QQ20160731-0@2x.png
Repository name:通常就寫自己自己要建的工程名。
Description:就是你對工程的描述了。
選擇Public。
點擊 “Create repository”
按照上面的步驟來就行了(注意記得在終端中輸入時把目錄切換到你要上傳的工程目錄下)。簡單分析下上面的步驟:
在github上面新建的項目可以按照下面的進行
- touch README.md //新建一個記錄提交操作的文檔
- git init //初始化本地倉庫
- git add README.md //添加
- git add 項目包含的文件
- git commit -m "first commit"http://提交到要地倉庫,并寫一些注釋
- git remote add origin https://github.com/aryehToDog/pageView.git //連接遠程倉庫并建了一個名叫:origin的別名
- git push -u origin master //將本地倉庫的東西提交到地址是origin的地址,master分支下
最后就是在github頁面,刷新下就OK拉~
二.利用第三方圖形化界面上傳項目的步驟:
QQ20160731-3@2x.png
由于已經push上github界面了不需要 git init
關于自己項目中是否已經下載git.如果已經添加了不知道在第三方圖形化工具中會push 不上去github網站.可以利用終端的兩個指令來查看:
如果你實在想嘗試命令操作,可參考:?
- 顯示:defaults write com.apple.finder AppleShowAllFiles -bool true
- 隱藏:defaults write com.apple.finder AppleShowAllFiles -bool false
1.git add -A
2.git commit -m "first commit"
3.git remote add origin https://github.com/aryehToDog/pageView.git
4.git push -u origin master
如果git remote add origin https://github.com/aryehToDog/pageView.git這一步失敗
提示出錯信息:fatal: remote origin already exists.
解決辦法如下:
$ git remote rm origin
然后在執行:
$ git remote add origin https://github.com/aryehToDog/pageView.git 就不會報錯誤了
關于刪除自己代碼項目
QQ20160731-1@2x.png
QQ20160731-2@2x.png
本人github地址:https://github.com/aryehToDog
群號: 255032637