前言
由於懶懶最近發現Google的Cloud Shell跟Github Codespaces相當好用,平常使用Visual Studio Code的時機也只有編寫部落格的文章。
所以懶懶目前打算使用Cloud Shell連接自己的Git倉庫,然後把寫好的文章Git push到GitHub Repository上,這樣一來就能隨時在雲端操作編寫文章囉!
Cloud Shell
Cloud Shell

教學
- 登入你的Google帳戶後進入Cloud Shell,接著在Shell輸入中Github CLI指令登入Github
gh auth login

- 選擇登入方式等等,請參考範例圖片
nullcode80625@cloudshell:~$ gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? How would you like to authenticate GitHub CLI? Paste an authentication token
Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
The minimum required scopes are 'repo', 'read:org', 'workflow'.
? Paste your authentication token:

- 進入 https://github.com/settings/tokens 網頁,建立新token

- 建立token名稱及權限,需給予
repo
,read:org
,workflow
之權限
- 複製token至Shell後登入完成
- 接著就可以Clone你的Repository囉!完成!