使用bash上传项目到osc@git上

首先要参照http://my.oschina.net/dxqr/blog/134811?p=2#comments

我每次第一次提交的时候都会遇到这个问题

第一次次将现有的项目提交到git上面会遇到这个问题。
$ git remote add test http://git.oschina.net/liangzhenghui/gitTest.git

Administrator@KEN  /g/code/gitTest/HelloWorld (master)
$ git push test master
Username for 'http://git.oschina.net': liangzhenghui
Password for 'http://[email protected]':
To http://git.oschina.net/liangzhenghui/gitTest.git
! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'http://git.oschina.net/liangzhenghui/gitTest
.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.



然后可以按照osc上朋友的方法这样解决:

先, git pull origin master
再    git push origin master

你可能感兴趣的:(使用bash上传项目到osc@git上)