使用git push origin master是出现如下问题;
Username for ‘https://github.com‘:
解决办法:
git remote set-url origin git+ssh://git@github.com/username/reponame.git
Username for ‘https://github.com‘: 输入的是github上的邮箱账号, 而不是github中设置的username, 这是个巨坑!!!
Password for ‘https://你的github邮箱@github.com‘: 输入github的登录密码,点击enter键即可.
~/github/ZYCycleViewSwift/ master: git push --set-upstream origin master
Username for ‘https://github.com‘: 1512450002@qq.com
Password for ‘https://1512450002@qq.com@github.com‘:
Counting objects: 14, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.88 KiB | 1.88 MiB/s, done.
Total 14 (delta 9), reused 0 (delta 0)
remote: Resolving deltas: 100% (9/9), completed with 7 local objects.
To https://github.com/ios-zhouyu/ZYCycleViewSwift
7846400..e90cd3d master -> master
Branch ‘master‘ set up to track remote branch ‘master‘ from ‘origin‘.
1
2
3
4
5
6
7
8
9
10
11
12
————————————————
版权声明:本文为CSDN博主「上进求知,认真思辨」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/kuangdacaikuang/article/details/90146891
使用git push origin master是出现如下问题;
Username for ‘https://github.com‘:
解决办法:
git remote set-url origin git+ssh://git@github.com/username/reponame.git
转载于:https://www.cnblogs.com/huangxingyuan/p/6492716.html
git remote set-url命令修改remote URL
git remote set-url传递两个参数
例如:从SSH切换到HTTPS的远程URL
xxxxxx@xxxxxx:~/workspace/goal$ git remote -v origin git@github.com:xxxxxx/SpringBoot.git (fetch) origin git@github.com:xxxxxx/SpringBoot.git (push)
xxxxxx@xxxxxx:~/workspace/goal$ git remote set-url origin https://github.com/xxxxxx/SpringBoot.git
xxxxxx@xxxxxx:~/workspace/goal$ git remote -v origin https://github.com:xxxxxx/SpringBoot.git (fetch) origin https://github.com:xxxxxx/SpringBoot.git (push)
The git remote set-url
command changes an existing remote repository URL.
Tip: For information on the difference between HTTPS and SSH URLs, see "Which remote URL should I use?"
The git remote set-url
command takes two arguments:
origin
https://github.com/USERNAME/REPOSITORY_2.git
if you‘re updating to use HTTPSgit@github.com:USER/REPOSITORY_2.git
if you‘re updating to use SSHList your existing remotes in order to get the name of the remote you want to change.
$ git remote -v
# origin git@github.com:USERNAME/REPOSITORY.git (fetch)
# origin git@github.com:USERNAME/REPOSITORY.git (push)
Change your remote‘s URL from SSH to HTTPS with the remote set-url
command.
$ git remote set-url origin https://github.com/USERNAME/REPOSITORY_2.git
Verify that the remote URL has changed.
$ git remote -v
# Verify new remote URL
# origin https://github.com/USERNAME/REPOSITORY2.git (fetch)
# origin https://github.com/USERNAME/REPOSITORY2.git (push)
The next time you git fetch
, git pull
, or git push
to the remote repository, you‘ll be asked for your GitHub username and password.
List your existing remotes in order to get the name of the remote you want to change.
$ git remote -v
# origin https://github.com/USERNAME/REPOSITORY.git (fetch)
# origin https://github.com/USERNAME/REPOSITORY.git (push)
Change your remote‘s URL from HTTPS to SSH with the remote set-url
command.
git remote set-url origin git@github.com:USERNAME/REPOSITORY2.git
Verify that the remote URL has changed.
$ git remote -v
# Verify new remote URL
# origin git@github.com:USERNAME/REPOSITORY2.git (fetch)
# origin git@github.com:USERNAME/REPOSITORY2.git (push)
git操作是出现Username for 'https://github.com':的验证问题
原文:https://www.cnblogs.com/qiaoyanlin/p/12083785.html