目标:将/ var / www / html / wp推送到远程github存储库中的newstart中。
ssh -T [email protected]
You've successfully authenticated, but GitHub does not provide shell access.
ssh和github处于良好状态。
在偏远地区
1.创建一个newstart
在github网页上命名的新项目。
在当地
2.cd / var / wwww / html / wp
3.sudo git init
4.git add *
5.git push origin master
错误:src refspec master不匹配。
错误:无法将某些参照推送到“原点”
感谢ffledgling,添加了两个命令。
git commit -m "First commit"
git remote add origin git+ssh://[email protected]/someone/newstart.git
git push origin master
To git+ssh://[email protected]/someone/newstart.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git+ssh://[email protected]/someone/newstart.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.
现在如何将/ var / www / html / wp推送到远程github存储库中?
您没有告诉git是什么origin
意思。您必须:
$ git remote add origin remote repository URL
在这里查看说明
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句