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信息、內容等等。。。。