今天用git clone下代码,修改,push提交,发现以下错误

[root@localhost gocache]# git push origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/zebozhuang/gocache.git/info/refs

查一下,原来是我用https clone代码,在.git下的remote url也会使用https,参考

http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed

在.git下修改config

    url = ssh://git@github.com/zebozhuang/gocache.git

 即可。

问题的实质是git的版本过低导致。参考

https://help.github.com/articles/https-cloning-errors/

问题解决!

----------------------------------------------Fri Apr 10 22:45:01 CST 201,出现新问题

git pull

There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details

    git pull <remote> <branch>

If you wish to set tracking information for this branch y

    git branch --set-upstream-to=origin/<branch> master

也属于老版本问题,解决

git branch --set-upstream-to=origin/master master

参考

http://stackoverflow.com/questions/10147475/git-checkout-tag-git-pull-fails-in-branch

 

相关文章:

  • 2021-08-19
  • 2021-08-27
  • 2021-07-25
  • 2021-08-20
  • 2021-11-29
猜你喜欢
  • 2021-08-16
  • 2021-10-12
  • 2021-04-29
  • 2022-01-17
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
相关资源
相似解决方案