git push -u origin master
------------------------------------------------------------------------------
错误 1.
-------------------------------------------------------------------------------
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/jackywgw/libevent.git/info/refs
fatal: HTTP request failed
解决方法:
在./git目录下有一个conf文件,打开它,将里面的
url = https://github.com/jackywgw/libevent.git
替换成
url = ssh://git@github.com/jackywgw/libevent.git
-----------------------------------------------------------------------------
错误2
gwwu@hz-dev2.com:~/test/libevent>git push -u origin master
Warning: Permanently added the RSA host key for IP address '192.30.255.112' to the list of known hosts.
Enter passphrase for key '/home/gwwu/.ssh/id_rsa':
To ssh://git@github.com/jackywgw/libevent.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://git@github.com/jackywgw/libevent.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
-----------------------------------------------------------------------------
原因:是远端服务器与本地有冲突,不一致
解决方法:
先git push origin master,然后再次git push -u origin master