Git 與 GitHub 的差異

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ac2728a4-ab5e-4168-ab33-2799ff66d854/Untitled.png

Git clone

git clone 下來的 repo 本身就包含 .git 資料夾了。 git init 是在一個新資料夾初始化 git 的時候使用。

New Repository

放到 Github 上

  1. git remote add origin https://....
  2. git push -u origin master

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4233d3a2-2b52-494c-9d69-a8d6561393b2/git_push_error.jpg

這裡練習遇到錯誤,就上網找了權限的問題花了一些時間。只要在自己的 GitHub 上加入本地端的密鑰就解決了

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7dfce510-26a1-4464-a5bc-dffe81f25314/Untitled.png

Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts。其實這只是一個警告無傷大雅(Github遇到Permanently added the RSA host key for IP address '192.30.252.128' to the list of known host)

參考這幾篇文章自己做一個本地端的 SSH 密鑰。錯誤:權限被拒絕(公鑰) 更開心的是還好有中文XD 不然我一定更難理解,以後工作上遇到就知道是什麼狀況了。

後來就成功推上去了~撒花

如果有在 GitHub 開過資料夾,就只要使用 git push -u [[email protected]](<mailto:[email protected]>):roroiii/JavaScript30.git master 就可以推上去了。

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f26dfd10-b029-46de-a12a-86e4ae728533/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7daf9758-1f84-400f-b997-a56fb08ad788/ABDA05A3-A96D-4395-949F-6BC281C1124F.jpg