1. 問題
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.
2. 官方訊息
如果帳戶啟用了雙重身份驗證,使用基於令牌或 SSH 的身份驗證
本文章以此方法來解決
申請雙重認證
GitHub官網:



手機App下載 Google Authenticator,然後用此App掃描QRCode
之後會在此生成一組限時的密碼,將此輸入


在此新增一組自己的電話,收簡訊認證
接下來又符合雙重認證的條件了
申請Token令牌







如果忘記,需要重新申請,這組就必須要刪除了
到此GitHub前置作業就完成囉
Sourcetree使用方法
有兩種方式可以使用
方法1(較不推薦)
Clone的時候格式如下
https://<token>@<git_url>.git
例如
網址為https://xxxx.git
toekn為ghp_ZGGGGqXi2nyRRRRRRRRw0qw1KKKK
clone時
https://ghp_ZGGGGqXi2nyRRRRRRRRw0qw1KKKK@xxxx.git
此方法有一個缺陷,必須要提供給別人token才能夠正常Push檔案
方法2(推薦)
曾經已經安裝過sourcetree,且已經有Login過帳號的人
就算移除Sourcetree重新安裝,依然會有問題,解決方案如下
先關閉Sourcetree
至C:\Users\<使用者帳號>\AppData\Local\Atlassian\SourceTree
刪除passwd檔案
重新打開Sourcetree,此時Push檔案時,會跳出下圖

Password是剛才申請的Token
Login後就可以正常使用囉
如果還是不行,刪除passwd檔案,重新Clone,再測一次
感谢 有用
讚讚