【问题标题】:git push >> fatal: no configured push destinationgit push >> 致命:没有配置推送目标
【发布时间】:2012-04-19 10:48:44
【问题描述】:

我仍在阅读一些关于 RoR 的指南,我被困在这里 Deploying The Demo App

我遵循了指示:

随着Microposts资源的完成,现在是把仓库推送到GitHub的好时机:

$ git add .
$ git commit -a -m "Done with the demo app"
$ git push

这里发生的错误是推送部分..它输出了这个:

$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
git push <name>

所以我尝试按照说明执行以下命令:

$ git remote add demo_app 'www.github.com/levelone/demo_app'
fatal: remote demo_app already exists.

所以我推:

$ git push demo_app
fatal: 'www.github.com/levelone/demo_app' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

我可以在这里做什么?任何帮助将不胜感激。

【问题讨论】:

标签: git github push git-push


【解决方案1】:

将 github 存储库添加为远程的命令(或其中的 URL)不太正确。如果我正确理解您的存储库名称,它应该是;

git remote add demo_app 'git@github.com:levelone/demo_app.git'

【讨论】:

  • 执行此操作后,我一直出现以下错误:git@github.com: Permission denied (publickey)
【解决方案2】:

您指的是这个“Ruby on Rails Tutorial ”的“2.3.5 Deploying the demo app”部分:

2.3.1 Planning the application 部分,请注意他们做了:

$ git remote add origin git@github.com:<username>/demo_app.git
$ git push -u origin master

这就是为什么一个简单的git push 起作用的原因(在这里使用一个 ssh 地址)。
您是否遵循了这一步并做出了第一次推动?

 www.github.com/levelone/demo_app

这不是推送到 GitHub 存储库的可写 URI。

https://levelone@github.com/levelone/demo_app.git

这应该更合适。
检查git remote -v 返回的内容,如果需要替换远程地址,如GitHub help page 所述,请使用git remote --set-url

git remote set-url origin https://levelone@github.com/levelone/demo_app.git
# or 
git remote set-url origin git@github.com:levelone/demo_app.git

【讨论】:

  • 有效! @VonC 但不幸的是,我再次推送后就卡住了……使用后:git push demo_app 它输出密码身份验证,成功登录后显示:No refs in common and none specified; doing nothing; perhaps you should specify a branch such as 'master'. Everything-up-to-date 我不明白..跨度>
  • @Marc 如果它要求输入密码,那么您一定错过了允许您以 demo_app 的合法所有者身份向 GitHub 进行身份验证的配置。例如(使用 https 远程 GitHub 地址)stackoverflow.com/questions/7129232/… 或(更完整)stackoverflow.com/questions/5377703/syncing-with-github/…
  • 第一个链接没有改变我推送的输出。我很好奇如何设置我的、@aproxy、aport……我有点迷路了 :( 对此感到抱歉。希望我没有打扰你寻求帮助..
  • @Marc:如果你通过代理访问互联网,你只需要设置它。
  • 哦,好吧..我在家里通过我们的 wifi 上网。我希望这有帮助吗?所以是的,当我推送$ git push 时,它会显示此文本error: error setting certificate verify locations: CA file: \bin\curl-ca-bundle.crt CApath: none while accessing https:\\levelone@github.com/levelone/demo_app.git/info/refs fatal:HTTPS request failed,当我推送它时我需要我的rails 服务器吗?还是我必须设置我的代理?
【解决方案3】:

我遇到了这个错误,以前我推送过根目录,现在我推送了另一个目录,所以我可以删除这个错误并运行下面的命令。

git add .
git commit -m "some comments"
git push --set-upstream origin master

【讨论】:

    【解决方案4】:

    我已经遇到过这个错误。我创建了一个 github 存储库并复制存储库 Url 并运行以下命令。

    git remote add service-center-app 'https://github.com/DeveloperAsela/service-centerapp.git'
    

    【讨论】:

    • 这正是accepted answer 所说的。
    【解决方案5】:

    当我在 Github 上使用 Visual Studio Code 时,这发生在我身上。我意识到上游分支由于某种原因是空的,并且推送不知道在哪里推送。使用“同步”解决了这个问题。

    【讨论】:

      【解决方案6】:

      我遇到了同样的问题

      如果你点击菜单按钮,使用 vs 代码向下推,拉然后向下滚动以推到和

      【讨论】:

        【解决方案7】:

        第一次推送时。你应该使用

        git push -u 原点主控

        【讨论】:

        • 这与this other answer 中的解决方案相同。 在回答已有答案的旧问题时,请确保提供新颖的解决方案或比现有答案更好的解释。
        猜你喜欢
        • 1970-01-01
        • 2020-03-17
        • 2019-08-19
        • 1970-01-01
        • 2011-04-26
        • 1970-01-01
        • 1970-01-01
        • 2011-12-31
        • 1970-01-01
        相关资源
        最近更新 更多