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

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

当前回答

在我看来,没有人建议 最简单的方法(也许我太笨了 觉得这太蠢了)"一种方式"但无论如何,试试这个:

git pull origin remoteBranchName
git switch remoteBranchName

这对我也有效(在我最后一次拉拉请求后,在遥控器上创建了一个分支)。

其他回答

首先,你需要做的是:

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

其他男人和女孩提供解决方案, 但也许我可以告诉你原因。

git 检查退出测试, 无效

Does nothing不等于doesn't work,所以我猜想当您在终端键入“ Gitt 检出测试” 并按键输入密钥时,没有出现消息,也没有出错。对不对?

如果答案是"是" 我可以告诉你原因

原因是在您的工作树上有一个名为“ 测试” 的文件( 或文件夹) 。

何时git checkout xxx被弃绝,

  1. 吉特看着xxx一开始是树枝名称, 但没有任何树枝名称测试 。
  2. 然后基特觉得xxx这是一条道路,幸运的是,有一个名为“测试”的文件。git checkout xxx表示丢弃任何修改xxx文件。
  3. 如果没有名字的文件xxx或,然后 Git 将尝试创建xxx根据某些规则,其中一项规则是设立一个部门,名为:xxx如果remotes/origin/xxx存在。

我用了那个:

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

git fetch && git checkout your-branch-name