git push 问题

前言:
加入rom开发组后,一直在看cm9系统的源码,现在要把修改的使用git版本控制工具上传至服务器,  所有开始熟悉git的基础使用。


基础的git命令倒是不难, 需要理解git,即和svn的区别,理解branch。

正题:
branch正确的情况下,
不知为什么,在push的时候总是出现:

fatal: remote error:
  You can't push to git://github.com/user_name/user_repo.git
  Use [email protected]:user_name/user_repo.git

的提示,
解决办法:

$ git remote rm origin
$ git remote add origin [email protected]:user_name/user_repo.git

$ git push origin

ok!
经过高人的点播,找到了原因:
如果在git clone的时候用的是git://github.com:xx/xxx.git 的形式, 那么就会出现这个问题,因为这个protocol是不支持push的

总结 git clone 和  git init 的不同
前者是协议git://
后者是http://






猜你喜欢

转载自dengzhangtao.iteye.com/blog/1709531