首页 > 解决方案 > 为什么我的 git 不会推送到我的 github 帐户?

问题描述

我创建了一个 github 存储库,然后在我的计算机上进入我的本地,我git init是否认为我做的一切都是正确的,但现在当我推送时出现错误。我不确定如何将我的 git local 与我的 github 链接起来。

我已经检查过git config -l,一切看起来都是正确的。

fatal: 'master' 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.

标签: gitgithub

解决方案


您必须将 Github 存储库作为远程存储库添加到本地存储库中。

git remote add origin "Your remote repository url"

编辑 如果远程源已经存在,请尝试:

git remote set-url origin "Your remote repository url"

推荐阅读