Git介紹
Git安裝
- 下載git、config user.name 和 user.email
Git工作流
內容是存儲在objects庫裏,操作只是改變index和master的指針
本地與遠程倉庫
創建ssh-key
登錄Github–settings–ssh and gpg keys
私鑰與公鑰
總結:公鑰和私鑰是成對的,它們互相解密。
公鑰加密,私鑰解密。
私鑰數字簽名,公鑰驗證。
舉例
比如有兩個用戶Alice和Bob,Alice想把一段明文通過雙鑰加密的技術發送給Bob,Bob有一對公鑰和私鑰,那麼加密解密的過程如下:
Bob將他的公開密鑰傳送給Alice。
Alice用Bob的公開密鑰加密她的消息,然後傳送給Bob。
Bob用他的私人密鑰解密Alice的消息。
添加遠程倉庫
$ echo "# test content" >> README.md
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin https://github.com/panbo24/test_muke.git
$ git push -u origin master