在用SourceTree提交代碼到GitHub的時候遇到這個問題:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v origin develop:develop
fatal: AggregateException encountered.
???????????????
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/****.git/'
Pushing to https://github.com/****.git
完成時帶有錯誤,見上文。
嘗試在 github的開發(fā)設(shè)置中:https://github.com/settings/tokens 生成一個Personal access tokens。
(教程:https://www.cnblogs.com/formybestlife/p/8193836.html)
推送的時候需要填用戶名密碼,密碼就是填這個生成的Personal access tokens。
但是還是不行。
最終的臨時解決辦法是:
1、SourceTree上方的【命令行模式】,打開命令行窗口。

1.png
輸入指令,比如推送本地的develop到github上的develop:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v origin develop:develop
2、彈出需要登錄驗證的界面,直接關(guān)掉。

2.png
3、在命令行輸入github上的用戶名,回車彈出輸入密鑰的界面,粘貼在github的開發(fā)設(shè)置中生成的Personal access tokens:

3.png
推送成功:

4.png