smartgit 因先建文件夹再建立远程库出现时的问题

failed to push some refs to 'https://gitee.com/pengzesheng/cordova_jqmobile.git'
! refs/heads/master:refs/heads/master [rejected] (non-fast-forward)
hint: Updates were rejected because the tip of your current branch is behind
Done
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
'master' rejected (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/pengzesheng/cordova_jqmobile.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

在remote——》add远程库之后,点击push出现上面的提示,因为出现上下箭头要先pull再push,但是却没有pull按钮可点击,这时打开项目下的.git(这个文件夹是隐藏的)找到config,添加

[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "origin"]

之后点击pull就会出现pull按钮,接着commit,push,一切正常

PS:一开始没有.gitignore文件夹也要自己建立,可从正常步骤的项目粘贴过来


猜你喜欢

转载自blog.csdn.net/qq_32524473/article/details/80627106
今日推荐