为什么我无法从 git 签出远程分支?

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

我的 git 有一个严重的问题。我的客户在 GitHub 上运行一个存储库。我正在主分支上工作,想要签出发布分支。

问题:我的 git-cli 无法检查这个分支。

我跑了:

git branch -a

结果:

* main
  remotes/origin/feature/commander
  remotes/origin/release/0.88
  remotes/origin/release/0.89
  remotes/origin/release/0.89

等等

所以我想使用我在 StackOverflow 和 git-tutorials 上找到的几次尝试来检查 release-branch 0.89

git checkout release/0.89

错误:路径规范“release/0.89”与 git 已知的任何文件不匹配

git checkout remotes/release/0.89

错误:路径规范“remotes/release/0.89”与 git 已知的任何文件不匹配

我还发现了类似的东西,我通常用它来创建一个新的远程分支:

git checkout -b release/0.89 origin/release/0.89

这给出了一个错误:

fatal: 'origin/release/0.89' is not a commit and a branch 'release/0.89' cannot be created from it

我在 Ubuntu 22 上使用 git 版本 2.34.1

我做错了什么?

git
1个回答
0
投票

是的,你可以。只管表演

git checkout origin/<branch>
© www.soinside.com 2019 - 2024. All rights reserved.