最近某個很久沒用的 git 倉庫要 push 時跳出警告說 account/password 的方式已無法使用,需用 personal access token,就上網研究了一下要如何使用 personal access token。
personal access token 要在 github 先申請好,會得到一組字串,然後要將本地端 git 倉庫更新為使用 github personal access token,最簡單的方法應該是用這裡提到的使用 command 的方式。
git remote set-url origin https://<token>@github.com/<username>/<repo>
我跑了這個 command 後就可以 push 了。
然後這裡有說到如果是用 ssh 的方式的話不會受影響,我有其他倉庫並沒有跳出警告叫我使用 personal access token,應該是因為已經使用了 ssh。
沒有留言:
張貼留言