【问题标题】:Git how to check to which repo project is connectedGit如何检查连接到哪个repo项目
【发布时间】:2018-09-25 09:50:02
【问题描述】:

当我使用android studio 时,如何查看连接了哪个 repo 项目?

我在bitbucket 中创建了一个新存储库,提取了那个新存储库并将连接到另一个存储库的旧项目复制到该文件夹​​,现在我想确保我将推送到正确的存储库。

【问题讨论】:

  • git 远程显示来源
  • git remote -v 列出远程名称及其 URL。

标签: git android-studio


【解决方案1】:

您应该能够通过单击 VCS > Git > Remotes 查看您的远程存储库。

在 Android Studio 中,您还可以单击控制台选项卡来调出终端。如果您设置了远程存储库,git remote -v 将列出它们以及它们的名称。

为确保推送到正确的存储库,只需确保在执行此操作时使用此列表中的正确存储库名称即可。

你的输出可能很简单

origin  https://github.com/username/myrepo (fetch)
origin  https://github.com/username/myrepo (push)

在这种情况下git push origin master 将推送到myrepo 的主分支。

如果您有多个远程存储库,它可能看起来像

origin  https://github.com/username/myrepo (fetch)
origin  https://github.com/username/myrepo (push)
repo2   https://github.com/username2/anotherrepo (fetch)
repo2   https://github.com/username2/anotherrepo (push)

在这种情况下,您可以在推送命令中使用originrepo2,具体取决于您要提交更改的位置。

【讨论】:

    猜你喜欢
    • 2020-05-30
    • 2020-04-07
    • 1970-01-01
    • 2017-06-03
    • 2023-03-29
    • 2010-11-20
    • 2023-03-11
    • 1970-01-01
    • 2016-08-01
    相关资源
    最近更新 更多