【问题标题】:HEAD of Cloud Source Repository is not pointing to any commitCloud Source Repository 的 HEAD 未指向任何提交
【发布时间】:2022-01-22 14:47:14
【问题描述】:

有没有办法配置 Cloud Source Repository 以将 HEAD 指向最新的提交?

我在 Cloud Source Repositories 中创建了一个新存储库,HEAD 没有指向远程存储库 (GCP) 中的任何内容,尽管在我的本地存储库中 HEAD 确实指向了最新的提交。

即使我可以看到远程存储库(云源存储库)中的内容,HEAD 也没有指向任何提交。

我使用的程序是:

  1. 在 Cloud Source Repositories 中创建远程存储库。
  2. 创建加密密钥。
  3. 在 GCP 中注册密钥。
  4. 在我的本地环境中注册密钥。
  5. 创建文件、添加更改、提交更改、将更改推送到远程存储库。

本地仓库:

远程 repo 的 HEAD:

远程仓库的主分支:

【问题讨论】:

  • Google Cloud 不允许您设置存储在 HEAD 中的名称。它创建了HEAD 附加到名称master(尽管名称本身还不存在),所以如果以及当您创建一个分支master 时,那就是当前分支。多年来,Google 一直要求对此采取行动:看起来他们永远不会这样做。

标签: git google-cloud-platform google-cloud-source-repos


【解决方案1】:

Cloud Source Repositories 似乎自动检测了主分支的旧命名约定,因为当我将分支名称从 main 更改为 master 时问题得到解决。

git branch -m main master
git push -u origin master

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-15
    • 2020-08-13
    • 1970-01-01
    • 1970-01-01
    • 2020-11-25
    • 1970-01-01
    • 1970-01-01
    • 2017-01-31
    相关资源
    最近更新 更多