Github 推入分支时git hub中出现致命错误

Github 推入分支时git hub中出现致命错误,github,Github,我想推到一个不是大师级的分支。我就是这么做的: git init git add . git commit -m "first" git push origin second (second is the name of a branch) but it say fatal: origin does not appear to be a git repository. fatal: could not read from remote repository.

我想推到一个不是大师级的分支。我就是这么做的:

    git init
    git add .
    git commit -m "first"
    git push origin second (second is the name of a branch) but it say


fatal: origin does not appear to be a git repository.
fatal: could not read from remote repository.
Please sure you have the correct access rights and the repository exists.
昨天晚上我能做到,早上它突然认不出我的树枝了!当我执行git分支时,它不显示我的分支,它只显示一个主分支。但是为什么我有时会遇到这个问题呢


谢谢:)

首先,确保您位于正确的分支:如果git分支没有列出“第二个”,您可以创建它:

git checkout -b second
实际上,“第二个”分支已经存在,我可以在github站点上看到它

然后:

(git-fetch-origin可能先排序)

然后,确保远程“源”存在:

git remote -v
然后,按下并设置本地分支机构的
origin/second

git push -u origin second
(有关详细信息,请参见“”)

试试看

git pull origin master
以前

git push origin master

我也犯了同样的错误,这对我很有效。

谢谢你的回复。实际上,“第二个”分支已经存在,我可以在github站点上看到它。但是它不能从命令中识别它。@sasha如果你想从本地repo推送,你需要先得到它。请看我编辑的答案。谢谢你的回答。目前我在主分支,我想把我的文件推到第二分支。但它不认识我的第二个分支。上次我推原始主机的时候。我在阿姆斯特丹分行的所有文件都被我想添加到第二个分行的文件所替换。这一次我真的很害怕再这样做。这就是我只想退房的原因。但它说无法从远程存储库读取@sasha首先需要签出第二个分支,然后在该分支中添加并提交。git remote-v返回什么?
git push origin master