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

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

当前回答

缩略git remote show <origin name>命令将列出所有分支(包括未跟踪的分支)。然后您可以找到要获取的远程分支名称。

示例:

git remote show origin

使用这些步骤获取远程分支 :

git fetch <origin name> <remote branch name>:<local branch name>
git checkout <local branch name > (local branch name should the name that you given fetching)

示例:

git fetch origin test:test
git checkout test

其他回答

从远程获取并检查分支。

git fetch <remote_name> && git checkout <branch_name> 

例如:

git 获取来源 git 检出功能/ XYZ-1234- Add- 警告

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

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 checkout -b feature/branch remotes/origin/feature/branch

这将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 遥控器存在, 第二个得到承诺。

对我们来说,似乎remote.origin.fetch配置存在一个问题。 因此, 我们无法看到比master, 如此git fetch [--all]没有帮助,也没有帮助。git checkout mybranchgit checkout -b mybranch --track origin/mybranch确实工作过,虽然肯定在遥远的地方。

仅允许上一个配置master要获取的 :

$ git config --list | grep fetch
remote.origin.fetch=+refs/heads/master:refs/remotes/origin/master

通过使用来修补它*从源头获取新信息 :

$ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'

$ git fetch
...
 * [new branch] ...
...

现在我们可以git checkout本地边远分支。

我不知道这个配置怎么会 出现在我们本地的仓库里