通过ssh推送文件但错误

时间:2017-06-04 13:26:39

标签: git github

> ! [rejected]        master -> master (non-fast-forward)
> error: failed to push some refs to 'git@github.com:wiwj1987ww/es6.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.

当我通过ssh推送文件时,它不起作用。

1 个答案:

答案 0 :(得分:1)

你的问题和问题并没有解决真正的问题。

这清楚地解释了问题所在。

error: failed to push some refs to 'git@github.com:wiwj1987ww/es6.git'
hint: Updates were rejected because the tip of your current branch is 
behind

您需要做的是检查您的分支,看看您是否修改过任何文件。如果您不需要这些更改,

您可以执行git stash或执行git reset --hard,在您重新设置时需要小心谨慎,并确保不需要删除。

或做git pull --rebase。这会将所有本地提交置于新拉动的更改之上。

Tim Biegeleisen已经指出这与SSH无关。