2021年11月29日 星期一

Github 改用 personal access token

markdown 最近某個很久沒用的 git 倉庫要 push 時跳出警告說 account/password 的方式已無法使用,需用 personal access token,就上網研究了一下要如何使用 personal access token。 personal access token 要在 github 先申請好,會得到一組字串,然後要將本地端 git 倉庫更新為使用 github personal access token,最簡單的方法應該是用[這裡](https://exerror.com/remote-support-for-password-authentication-was-removed-on-august-13-2021-please-use-a-personal-access-token-instead/)提到的使用 command 的方式。
git remote set-url origin https://<token>@github.com/<username>/<repo>
我跑了這個 command 後就可以 push 了。 然後[這裡](https://iter01.com/611911.html)有說到如果是用 ssh 的方式的話不會受影響,我有其他倉庫並沒有跳出警告叫我使用 personal access token,應該是因為已經使用了 ssh。 --- * [[Solved] remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead](https://exerror.com/remote-support-for-password-authentication-was-removed-on-august-13-2021-please-use-a-personal-access-token-instead/) * [使用personal access token進行Github認證](https://iter01.com/611911.html)

沒有留言:

張貼留言