我正在尝试使用以下命令在Github中的现有存储库中进行推送,
git push -u origin master我得到以下错误,
To https://github.com/Chaklader/Technical-Interview.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Chaklader/Technical-Interview.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.正如它所暗示的那样,我尝试使用以下命令进行拉动,
git pull origin master这似乎也不起作用。如何解决这个问题?
发布于 2016-10-14 11:11:43
您的本地主分支位于远程分支之后。
在添加本地更改之前,使用.first与远程同步
git pull(使用git log --oneline检查) .It应该与远程更改匹配您的主分支日志,如下所示。
a570f1e design aptterns
607f53c added different deign patterns
c586b42 Update mySyntax.cpp
17ffb35 Update README.md
66e75d3 Update README.md
e66d701 update
3344773 first commit
0bd776c first commit
c1a0898 first commit
2468750 first commit在上面的基础上,使用(push .then remote master分支)提交您的本地更改
git push origin HEAD:refs/for/masterhttps://stackoverflow.com/questions/40034241
复制相似问题