Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git处处阻挠我:我无法承诺我的项目_Git_Github - Fatal编程技术网

Git处处阻挠我:我无法承诺我的项目

Git处处阻挠我:我无法承诺我的项目,git,github,Git,Github,所以我现在回到我几个月没用过的项目,显然有些地方出了问题: git push origin master 我的回答是: error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/username/project.git' 所以,我在谷歌上搜索这个错误,并被重定向到一堆其他StackOverflow问题,当我尝试运行建议的命令时,所有这些问题都会产生错

所以我现在回到我几个月没用过的项目,显然有些地方出了问题:

git push origin master
我的回答是:

error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/username/project.git'
所以,我在谷歌上搜索这个错误,并被重定向到一堆其他StackOverflow问题,当我尝试运行建议的命令时,所有这些问题都会产生错误

我愿意尝试任何事情,我希望我能更好地解释我自己,但我对Git的理解还不够,所以我不想这么做

我从哪里开始

git日志返回致命错误:错误的默认版本“HEAD”

这是典型的空回购。
由于存在origin,请尝试在提交origin/master的同时创建主分支(首先保存所有正在进行的工作):


git分支-avv返回什么?和
git日志
?您的本地repo中是否至少有一个commit?能否验证GitHub上是否存在远程分支?您可以通过舒适的web浏览器进行检查。@VonC git branch-avv返回
remotes/origin/master adc353e Update README.md
,该文件与我上次提交给GitHub的文件相匹配。git日志返回
致命:错误的默认版本“HEAD”
git日志--所有git日志--所有返回:
提交ADC353E95B662771AD446590A0DF7F037086CAE作者:Me日期:Sat Feb 21:07:56 2015+1300更新自述。md提交26a9e28aa834357be9eb865790e429f34eef21d7作者:Me日期:Sat Feb 21:03:23+1300更新README.md提交a17a679cd640e20f64c93859680260e0af0a44bb作者:Me日期:2015年2月21日星期六20:59:12+1300初始提交
返回分支主机设置以从源站跟踪远程分支主机。。然后,
git checkout master
返回
错误:以下未跟踪的工作树文件将被checkout覆盖:README.md请在切换分支之前移动或删除它们。中止
@EchoLogic为了安全起见,在执行
git checkout
命令之前,尝试
git stash
git branch master origin/master
现在返回
致命:名为“master”的分支已经存在
。紧跟其后的是:
git stash
,它给出了母版上保存的工作目录和索引状态WIP:adc353e Update README.md头现在位于adc353e Update README.md。然后
git checkout master
返回:
已经在“master”上,您的分支是“origin/master”的最新分支。
@EchoLogic您已经完成了git分支,无需重复。@EchoLogic现在在“master”上,您可以添加、提交和推送!
git branch master origin/master
git checkout master