【问题标题】:Push/Fetch command for Git in QtCreator works only in Remotes-menuQtCreator 中 Git 的 Push/Fetch 命令仅适用于 Remotes-menu
【发布时间】:2014-10-24 12:52:55
【问题描述】:

我目前正在使用 QtCreator 2.5.0 和 Git。我在项目的根目录中初始化了一个本地仓库。之后,我在 GitHub 上添加了我的远程仓库(SSH 密钥等 - 全部设置)。出于某种原因,尽管当我使用 Tools->Git->Push/Fetch 时 QtCreator 拒绝将我的代码推送/获取到远程仓​​库。但是,如果我去 Tool->Git->Remotes... 并从那里 pus/fetch 它正在工作。不用说,这至少对我来说是一种非常奇怪的行为。从我的终端内部推动也不是问题,而且就像一个魅力。

这是我到目前为止所做的:

  • 我已经在终端中使用 git 检查了所有设置是否如下所示。

    USER:~/QtProjects/TestProject$ git remote -v
    TestProject git@github.com:USERNAME/TestProject.git (fetch)
    TestProject git@github.com:USERNAME/TestProject.git (push)
    
  • 在终端成功推送/获取了几次(结果在 GitHub/本地 repo 上也可见)

  • 在 QtCreator 的 Remotes-menu 中成功推送/获取了几次(结果在 GitHub/本地 repo 上也可见):

    21:46 Executing in /home/USER/QtProjects/TestProject: /usr/bin/git push TestProject
    Everything up-to-date
    The command '/usr/bin/git' finished successfully.
    
  • 使用 Tools->Git->Push/Fetch 多次推送/获取失败。

现在我注意到,当使用 Tools->Git->Push/Fetch 推送时,我得到一个空字符串,其中我的仓库名称应如上所示以及缺少推送目的地的旧错误(下面我'已用 MISSING_REPO_NAME_HERE 标记它):

21:46 Executing in /home/redbaron/QtProjects/HskaCompiler: /usr/bin/git push MISSING_REPO_NAME_HERE
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>

The command '/usr/bin/git' terminated with exit code 128.

有没有人经历过这样的事情,也许知道如何解决它?我最近从 Ubuntu 12.04 LTS 32bit 切换到 Debian Wheezy 7.6 64bit,不知道 QtCreator 的哪个版本(我猜是 Precise 的最新版本)。在 Ubuntu 中我没有遇到这样的问题。这里最有趣的是,QtCreator 实际所做的就是像我一样调用 git remote -v - 在项目的根目录中。在一种情况下(远程菜单)它可以工作,在另一种情况下 - 不是。

【问题讨论】:

    标签: git github push qt-creator git-fetch


    【解决方案1】:

    这似乎是 Qt Creator 或 git(至少是我正在使用的版本)中的某种错误,或两者兼而有之。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-13
      • 2017-04-26
      • 1970-01-01
      • 1970-01-01
      • 2019-03-26
      • 1970-01-01
      相关资源
      最近更新 更多