導航:首頁 > 編程語言 > 網站github上傳代碼

網站github上傳代碼

發布時間:2023-08-17 22:47:44

Ⅰ 怎樣在github上傳代碼

創建新的git倉庫

設置新倉庫

Ⅱ 怎麼將代碼上傳到github

最近需要將課設代碼上傳到Github上,之前只是用來fork別人的代碼。

這篇文章寫得是windows下的使用方法。

第一步:創建Github新賬戶

第二步:新建倉庫

第三部:填寫名稱,簡介(可選),勾選Initialize this repository with a README選項,這是自動創建REAMDE.md文件,省的你再創建。

第四步:安裝Github shell程序,地址:http://windows.github.com/

第五步:打開Git Shell,輸入以下命令生成密鑰來驗證身份

ssh-keygen -C '[email protected]' -t rsa

連續三個回車之後會在windows當前用戶目錄下生成.ssh文件夾,和linux一樣。

第九步:切換到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 originhttps://github.com/Flowerowl/stumansys.git即可。

在執行git push origin master時,報錯:

error:failed to push som refs to.......

則執行以下語句:

git pull origin master

先把遠程伺服器github上面的文件拉先來,再push 上去。

最後,你可以去項目核芹稿頁面查看了~~代碼上傳成功!

Ⅲ github本地如何上傳代碼

1.第一步,當然是在github上創建你的遠程庫文件

2.完逗氏迅成github上的遠程庫創建後,接著就是查看github是否配置SSH KEY

終端 cd ~/.ssh查看有無.ssh目錄,如果有,一般此目錄下一般都會存在id_rsa ,id_rsa_pub文件;

若提示No such file or directory,則需創建key ,創建key不在復述

3.在有了key,並且在github上配置了key之後,此時還不能獲得上傳許可權,要將key激活

在終端輸入$ ssh -T [email protected] 按照提示,輸入yes和你配置key時創建的密碼

回到網頁刷新即可發現,key已被激活(鑰匙由灰色變成綠色)

4,在一切准備就緒後,我們就要來創建本地的庫,並且提交到github上

cd 到自己本地(desktop)的文件目錄

$ git init 在改目錄下生成.git目錄

$ git add . 添加所有文件到本地庫

$ git commit -m "first commit" 提交文件到本地庫

5.接下來就是要關聯遠程github上的剛創建的庫

$ git remote add origin [email protected]:Hanh94(你的github用戶名)/AFNTool(你的github上的項目名稱).git 將git本地倉庫和遠程github倉庫關聯

$ git pull origin master 正確情況下,輸入密碼,會進入vim編輯,一般直接:wq保存退出即可

閱讀全文

與網站github上傳代碼相關的資料

熱點內容
數控車床編程g40是什麼意思 瀏覽:782
人們花錢為什麼逐漸網路化 瀏覽:272
如何用編程辦理電信業務 瀏覽:189
數控磨床小圓弧怎麼編程 瀏覽:390
桐鄉編程貓在哪裡 瀏覽:69
同一文件夾存儲大量文件 瀏覽:126
chrome修改js 瀏覽:842
用pad怎麼發word文件怎麼打開 瀏覽:465
哪個網站有幼 瀏覽:299
航班APP哪個最好 瀏覽:590
網路原創如何增強教育活力 瀏覽:527
蘋果第三方打開文件 瀏覽:310
蘋果電腦桌面移除的文件夾怎麼恢復 瀏覽:292
在文件名前添加字元 瀏覽:424
javaexcel導出控制項 瀏覽:484
怎麼樣粉碎文件 瀏覽:798
谷歌網站怎麼更新 瀏覽:934
svn命令行刪除文件夾 瀏覽:277
如何建立共享數據表 瀏覽:247
ps存儲覆蓋了源文件 瀏覽:668

友情鏈接