突发事件^O^

今天运行git push origin hexo命令的时候出现以下错误提醒

1
2
3
4
5
6
7
8
9
10
11
12
13
$ /c/Users/DELL/Desktop/updated.sh
On branch hexo
Your branch is up to date with 'origin/hexo'.

nothing to commit, working tree clean
To github.com:nolevo/nolevo.github.io.git
! [rejected] hexo -> hexo (fetch first)
error: failed to push some refs to 'git@github.com:nolevo/nolevo.github.io.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 integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

原因是我直接在github上面修改了某个文件造成了冲突,解决办法是先重新拉取远程的分支到本地。

1
git pull origin hexo

下面这个是提示push不成功,提示超时之类的可以过一阵再试。

1
2
3
4
5
6
7
8
9
[hexo ade5eb2] updated local at 2017-11-25 16:49
4 files changed, 440 insertions(+)
create mode 100644 themes/next/layout/_macro/post111.swig
create mode 100644 "themes/next/source/css/_custom/custom\345\211\257\346\234\254.styl"
ssh: Could not resolve hostname github.com: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

运行ssh -T命令即可测试ssh key是否链接成功:

1
2
$ ssh -T git@github.com
Hi nolevo! You've successfully authenticated, but GitHub does not provide shell access.

End