我知道类似的问题已经被问过了。
但是,我相信我的问题是由于我之前犯的一个错误造成的,因此不同:让我解释一下。
一切都很顺利,我可以:
git add .
将所有文件从我的本地存储库添加到暂存区。git commit -m "message here"
为我的提交添加消息。git push origin master
将我的文件上传到GitHub。git push heroku master
将我的文件上传到Heroku。
然而,在某个时候,我在本地创建了一个名为add-calendar-model
的新分支,以防万一应用程序开发的后续步骤出现问题...
...这正是发生的事情。
然而,尽管尝试了多次,我仍然无法将最初的代码(即在创建新分支之前的代码)从master
分支获取到我的本地存储库。
所以,我决定手动从我的GitHub上master
分支中删除所有文件并git clone
它。
这样,我就把所有的文件都找回来了,但现在,我无法再推送到远程存储库。
每次我尝试运行git push origin add-calendar-model
或git push origin master
时,我都会收到以下错误:
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我对Git和GitHub不是很熟悉,正如你现在所猜测的那样,我必须承认我不知道该如何解决这个问题。
有什么想法吗?