致命:无法将 HEAD 解析为提交

问题描述 投票:0回答:0

我有两个存储库。一个在 gitlab 上,一个在 github 上。 Github repo 仅包含基本的代码框架,但实际代码位于 gitlab 本身。我正在尝试使用以下命令将 gitlab 代码连同历史记录一起移动到 github。当我触发下面提到的最后一个命令时,我得到“致命的:无法将 HEAD 解析为提交”。你能帮我解决这个问题吗?

  • git filter-repo --path GitlabRepo/
  • git远程添加github github:/GithubRepo.git
  • git 获取 github
  • git checkout -b old_github_repo
  • git rebase -X 我们的 github/main

最后一个命令的输出:“”fatal: Could not resolve HEAD to a commit“”

我尝试使用上述命令将 gitlab 代码移动到 github,我希望将代码从 gitlab 移动到具有历史记录的 github。

git github gitlab
© www.soinside.com 2019 - 2024. All rights reserved.