修改git密码后导致提交失败

概述

修改git密码后,在Windows平台用TortoiseGit提交时会出现类似如下的401错误。

git.exe push --progress "XXX" master

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 6 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 288 bytes | 288.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
error: RPC failed; HTTP 401 curl 22 The requested URL returned error: 401
Everything up-to-date

原因是Windows本地自动保存了提交时需要的用户名和密码。

解决方案

  1. 打开“控制面板”->“用户账户”->“管理你的凭据”->“Windows凭据”
  2. 在“普通凭据”列表下寻找git字样的凭据,直到找到你的用户名。修改或删除该凭据。

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注