首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法将代码推送到Github中

无法将代码推送到Github中
EN

Stack Overflow用户
提问于 2018-06-21 08:52:56
回答 3查看 5.8K关注 0票数 2

当尝试运行'git push‘时,不断收到此错误:

代码语言:javascript
复制
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

我已经执行了这个过程,但是我得到了另一个错误:

代码语言:javascript
复制
fatal: 'angrails-front' 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.

不知道从这一点上该怎么做...

EN

Stack Overflow用户

发布于 2018-06-21 14:08:36

我将首先从一个注释开始。

注意:如果你得到的似乎不是git存储库,请从你的项目目录中运行git init

首先通过运行以下命令检查是否有源远程设置

代码语言:javascript
复制
git remote -v

它应该显示如下所示

代码语言:javascript
复制
origin: some_url (push)
origin: some_url (fetch)

如果上面没有显示任何内容,则必须手动添加。执行以下操作

代码语言:javascript
复制
git remote add origin <your_origin_url>

在上面的代码中,<your_origin_url>是你的项目仓库。

要获取项目存储库,只需在github中打开项目并复制url即可。现在试试git push,它应该是有效的。如果不是,请在下面发表评论。

票数 1
EN
查看全部 3 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50958919

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档