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

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

当前回答

我被困在一个状况中看到error: pathspec 'desired-branch' did not match any file(s) known to git.以上所有建议。我正在讨论Git 1.8.3.1版本。

所以这个为我工作:

git fetch origin desired-branch
git checkout -b desired-branch FETCH_HEAD

背后的解释是,我注意到 当我拿起遥控树枝时,时前:

git fetch origin desired-branch

From github.com:MYTEAM/my-repo
    * branch            desired-branch -> FETCH_HEAD

其他回答

首先,你需要做的是:

git fetch如果你不知道 分支名称

git fetch origin branch_name

第二,您可通过下列方式检查远程分支进入本地 :

git checkout -b branch_name origin/branch_name

-b将从您选中的远程分支中以指定的名称创建新分支 。

命令

git fetch --all
git checkout -b <ur_new_local_branch_name> origin/<Remote_Branch_Name>

等于

 git fetch --all

时和时

 git checkout -b fixes_for_dev origin/development

两者将创造latest fixes_for_dev调自development

在这种情况下,你可能想要 创建本地test正在跟踪远程test分支 :

$ git branch test origin/test

先前版本的git,你需要一个明确的--track选项,但当您正在从一个远程分支进行分支分割时,这是默认值。

创建本地分支切换到它,使用:

$ git checkout -b test origin/test

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

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'

我用了那个:

git clean -fxd                         # removes untracked (new added plus ignored files)

git fetch
git checkout {branchname}

git reset --hard origin/{branchname}   # removes staged and working directory changes