git 上传代码时提示输入用户名和密码

用 git 往 github上传代码时,提示输入用户名和密码:

$ git config --list 查看自己所有的配置,包括user.name 等;

$ git push -u origin master
Username for 'https://github.com': 此处输入list查看的用户名

在密码框输入密码,连接失败;

最终发现,这个用户名和密码是你关联远程仓库的那个人的用户名和密码

git remote add origin https://github.com/Applewan/tictactoe.git(这个远程的账户)
再次push:

$ git push -u origin master
Username for 'https://github.com': Applewan

在密码框输入密码,上传成功;

你可能感兴趣的:(代码管理类-git,git)