码迷,mamicode.com
首页 > 其他好文 > 详细

Fix git 提交代码错误

时间:2015-04-10 23:51:20      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:

今天用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

 

Fix git 提交代码错误

标签:

原文地址:http://www.cnblogs.com/zhuangzebo/p/4415808.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!