$Git Error记录
1. ssh: Could not resolve hostname github: Name or service not known
ssh: Could not resolve hostname github: 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.
一般是
git remote add origin git@github.com:GitHub用户名/新建的仓库的英文名.git
哪里没写对的锅
二. error: failed to push some refs to ‘git@github.com:ngp320/hexo-jsimple-src.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.
npm ERR! code ELIFECYCLE
原因: 在不同的机器上上做了提交?? (或者把本地分支提交的记录删除了)
远程分支上存在本地分支中不存在的提交,往往是多人协作开发过程中遇到的问题,可以先
fetch
再merge
,也就是pull
,把远程分支上的提交合并到本地分支之后再push
。
解决:
如果你确定远程分支上那些提交都不需要了,那么直接git push origin master -f
,强行让本地分支覆盖远程分支。。。