有人推了一个分行testgit push origin test共享仓库的共享仓库。git branch -r如何查看遥控器test我试过了

  • git checkout test,它没有做任何事情
  • git checkout origin/test给给* (no branch)

当前回答

你可以试试

git fetch remote
git checkout --track -b local_branch_name origin/branch_name

git fetch
git checkout -b local_branch_name origin/branch_name

其他回答

出于某种原因,我不能做:

git checkout -b branch-name origin/branch-name

它在抛出错误:

致命 : “ 来源/ 分支名称” 不是一个承诺, 无法从中创建分支“ 分支名称 ” 。

我必须这样做:

git checkout -b branch-name commit-sha

你可以试试

git fetch remote
git checkout --track -b local_branch_name origin/branch_name

git fetch
git checkout -b local_branch_name origin/branch_name

这将DWIM DEWIM DEWIM DEWIM DEWIM DEWIM DEWIM DEWIM DEWIM DEWIM DIWIM DEWIM DIWIM DIWWM DI DIWIM DI DIWIM DI DIWIM DI DIWM DIWIM DI DIWM DI DI DIWIM DI DI DIWM远程未命名来源( 用于远程未命名来源) 。文档文件文件):

$ git checkout -t remote_name/remote_branch

要添加一个新的远程, 您需要首先做以下操作 :

$ git remote add remote_name location_of_remote
$ git fetch remote_name

第一个告诉Git 遥控器存在, 第二个得到承诺。

git branch -r表示对象名称无效, 因为该分支名称不在 Git 的本地分支列表中。 更新您的本地分支列表来源 :

git remote update

然后再试着检查一下你的远程分支

这对我管用

我相信git fetch拉拉进全部( 全部)远端树枝,这不是最初的海报所要的。

请遵循命令创建空文件夹。 请输入并使用此命令 :

saifurs-Mini:YO-iOS saifurrahman$ git clone your_project_url
Cloning into 'iPhoneV1'...
remote: Counting objects: 34230, done.
remote: Compressing objects: 100% (24028/24028), done.
remote: Total 34230 (delta 22212), reused 15340 (delta 9324)
Receiving objects: 100% (34230/34230), 202.53 MiB | 294.00 KiB/s, done.
Resolving deltas: 100% (22212/22212), done.
Checking connectivity... done.
saifurs-Mini:YO-iOS saifurrahman$ cd iPhoneV1/
saifurs-Mini:iPhoneV1 saifurrahman$ git checkout 1_4_0_content_discovery
Branch 1_4_0_content_discovery set up to track remote branch 1_4_0_content_discovery from origin.
Switched to a new branch '1_4_0_content_discovery'