使用SourceTree工具拉取成功,但 Push代码提示Invalid username or password.

我使用的基本的https

错误提示图:

解决方法一:

首先:打开Source Tree ,点击左上角Source Tree ,选择偏好设置,再打开账户点击添加,如下图所示:

然后填写基本信息,点击保存,push成功,如下图所示

虽然不知道原理是什么,实验Push是成功的,如果有好的方法请评论告知,感谢。

之前也找过其他方法,不过没有成功,之前测试的方法是在命令行中输入:

git config --global user.name "xxx" //自己的用户名

git config --globla user.email "xxx" //填写自己的邮箱

在这里做个参考。

原文地址:https://www.cnblogs.com/lulushen/p/8137181.html