Github備記
第一步:建立Github新賬戶
第二步:新建倉庫
第三部:填寫名稱,簡介(可選),勾選Initialize this repository with a README選項,這是自動建立REAMDE.md檔案,省的你再建立。
第四步:安裝Github shell程式,地址:http://windows.github.com/
第五步:開啟Git Shell,輸入以下命令生成金鑰來驗證身份
ssh-keygen -C 'your@email.address' -t rsa
連續三個回車之後會在windows當前使用者目錄下生成.ssh資料夾,和linux一樣。
把資料夾下的id_rsa.pub檔案內容全部複製。
然後開啟github賬戶設定,如圖
開啟ssh keys
然後在title隨便輸入,key欄貼上剛才的金鑰。
第六步:在Git Shell下輸入命令測試剛才的公鑰是否認證正確。
ssh -T git@github.com
正確結果會顯示:
Warning:Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. Hi Flowerowl! You've successfully authenticated, but GitHub does not provide shell access.
warning 不用理會。
第七步:clone剛才新建的repository 到本地,輸入命令:
git clone https://github.com/Flowerowl/stumansys.git
這時會在目錄下生成:
第八步:將想上傳的程式碼目錄拷貝到此資料夾下:
第九步:切換到Git shell 命令列下,輸入命令:
git init git commit -m 'stumansys' git remote add origin https://github.com/Flowerowl/stumansys.git git push origin master
如果執行git remote add origin
https://github.com/Flowerowl/stumansys.git
,出現錯誤:
fatal: remote origin already exists
則執行以下語句:
git remote rm origin
再往後執行git remote add origin https://github.com/Flowerowl/stumansys.git 即可。
在執行git push origin master時,報錯:
error:failed to push som refs to.......
則執行以下語句:
git pull origin master
先把遠端伺服器github上面的檔案拉先來,再push 上去。
最後,你可以去專案頁面檢視了~~程式碼上傳成功!
2.新增新版本庫出錯
git push origin master
error: src refspec master does not match any.
error: failed to push some refs to 'git@localhost:mysite.git'
相關文章
- Github操作完備指南Github
- GitHub 提交程式碼必備指南!Github
- GitHub學習筆記Github筆記
- (二)GitHub使用隨記Github
- ABAP開發的Github issue備份工具Github
- 使用 GitHub Actions 自動備份程式碼倉Github
- GitHub學習除錯記錄Github除錯
- github--學習筆記(一)Github筆記
- github--學習筆記(二)Github筆記
- 什麼是Github的後設資料metadata以及如何備份github上的資料Github
- 解決“用PicGo-2.3.0-beta5 + GitHub做部落格圖床,github倉庫圖片檔案不顯示”的問題記錄(備忘)PicGoGithub圖床
- github contribbution 沒記錄怎麼破?Github
- linux 備忘記錄Linux
- HCIE Security 雙機熱備 備考筆記(幕布)筆記
- 特性標記清理:GitHub Actions 來幫忙!Github
- 2面準備記錄
- GitHub Pages + Hexo搭建個人部落格網站-github風格-採坑記錄GithubHexo網站
- GitHub 極簡學習筆記(更新完畢)Github筆記
- 記錄我github的hexo的搭建Blog之路GithubHexo
- windows 備用記憶體清理Windows記憶體
- 清除 GitHub 歷史記錄的隱私資訊Github
- goland匯入GitHub包顯示紅色標記GoLandGithub
- 微信聊天記錄的備份
- iOS開發備忘筆記 (3)iOS筆記
- iOS開發備忘筆記 (2)iOS筆記
- 3DS MAX備忘筆記3D筆記
- 過年必備!親戚計算器「GitHub 熱點速覽 v.23.02」Github
- Android備忘錄《記憶體洩漏》Android記憶體
- 異構計算的“備胎上位記”
- 部落格園部落格記錄備份
- 3DS MAX備忘筆記【總】3D筆記
- githubGithub
- 《GitHub 入門與實踐》閱讀筆記(第4章)Github筆記
- Gitter:高顏值GitHub小程式客戶端誕生記Github客戶端
- Gitter - 高顏值GitHub小程式客戶端誕生記Github客戶端
- PostgreSQL WAL解析:構建WAL記錄準備SQL
- 3DS MAX備忘筆記(石墨工具)3D筆記
- [學習筆記]SQL server完全備份指南筆記SQLServer
- linux mysql定時備份指令碼記錄LinuxMySql指令碼