今天用sourcetree拉取代碼的時候報錯:
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/shliang0603/Yolov4_DeepSocial.git/': The requested URL returned error: 403
通過查看網站https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information,得知原先的密碼憑證從2021年8月13日
開始就不能用了,必須使用個人訪問令牌(personal access token)
,也就是說,要把個人密碼
替換成token。
那么首先,需要在GitHub上創建token。
參考:https://blog.csdn.net/weixin_41010198/article/details/119698015
接下來就是修改密碼。
打開mac電腦的鑰匙串訪問,圖標大概是這個樣子:
打開它,在右上角的搜索欄搜索git,如下圖所示:
雙擊Github Credentials,如下圖所示:
顯示密碼之后,將access_token=后面的內容刪掉,改為剛剛創建好的personal access token即可。
然后再重新拉取代碼。
如果有問題,在sourcetree的設置里打開遠程倉庫,如下圖所示:
點擊編輯配置文件,查看里面的鏈接是否正確。