實現自己代碼在githab託管(mac)

1、電腦安裝git
2、申請自己的githab帳號
3、打開git操作窗口,執行以下命令

$ssh-keygen -t rsa -C [email protected](註冊github時的email)

->輸入 :key
-> 輸入:密碼

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/chenwenping/.ssh/id_rsa): key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in key.
Your public key has been saved in key.pub.
The key fingerprint is:
SHA256:I1kS+i4fadR2UYfePtyzBgE0nJsOQF9fyd2o0vi1q7M [email protected]
The key’s randomart image is:
+—[RSA 2048]—-+
| o. o+o.oo+|
| . o. .=+.ooo|
| . . o..+++ |
| . = .o++.o |
| = S +o +.o |
| o + o …=..|
| . = .oo|
| + . . .o |
| . E+. |
+—-[SHA256]—–+

4、生成文件 “key.pub“,打開該文件

5、登錄github添加ssh(添加公鑰)

這裏寫圖片描述
圖一
這裏寫圖片描述
圖二
這裏寫圖片描述
圖三

6、將文件“key.pub“中的內容拷貝到圖三key下面的空格中。。。

7、在githab添加repository
這裏寫圖片描述
圖四
這裏寫圖片描述
圖五
這樣就有一個repository了

可以在在自我主頁看得到
這裏寫圖片描述
圖六
點擊進去可看到
這裏寫圖片描述

8、進入自己本地demo目錄

順序執行以下命令:
(1) git init
(2) git add 你的本地文件名
(3) git commit -m ” 提交說明日誌”
(4) git remote add origin https://github.com/chenwenping863/chenwendagger.git
(5) git push -u origin master

然後就可以在Github中看得到demo信息、內容等等。。。。

發佈了28 篇原創文章 · 獲贊 1 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章