`
lindexi-gd
  • 浏览: 130847 次
社区版块
存档分类
最新评论

git上传代码到code.csdn.net出错

 
阅读更多

用git push代码到csdn code的时候出现错误
error:failed to push some refs to …
Dealing with “non-fast-forward” errors
From time to time you may encounter this error while pushing:
$ git push origin master
To ../remote/
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to ‘../remote/’
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the ‘non-fast forward’
section of ‘git push –help’ for details.

找了很多网上的答案都是
先把git的东西fetch到你本地然后merge后再push

$ git fetch
$ git merge

$ git pull 

都是错的,正确的是

$ git pull git@code.csdn.net:你的名字\……

一定要加 git@这
然后push

$ git push -u 名字 master

master代表主分支

<script type="text/javascript"> $(function () { $('pre.prettyprint code').each(function () { var lines = $(this).text().split('\n').length; var $numbering = $('<ul/>').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('<li/>').text(i)); }; $numbering.fadeIn(1700); }); }); </script>

版权声明:本文为博主原创文章,未经博主允许不得转载。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics