git push 问题

前言:

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

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

正题:

branch正确的情况下,

不知为什么,在push的时候总是出现:

fatal:remoteerror:

Youcan'tpushtogit://github.com/user_name/user_repo.git

Usegit@github.com:user_name/user_repo.git

的提示,

解决办法:

$gitremotermorigin

$gitremoteaddorigingit@github.com:user_name/user_repo.git

$gitpushorigin

ok!

经过高人的点播,找到了原因:

如果在gitclone的时候用的是git://github.com:xx/xxx.git的形式,那么就会出现这个问题,因为这个protocol是不支持push的

总结gitclone和gitinit的不同

前者是协议git://

后者是http://

相关推荐