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

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

当前回答

使用使用fetch以拉动全部远程

   git fetch --all

要列出远程分支 :

   git branch -r

列出您所有的分支

   git branch -l
   >>outpots like-
     * develop
       test
       master

要取出/更改分支

   git checkout master

其他回答

git 检出 -b "Branch_name" [B 意指创建本地分支]

git 分支-all

git 检出 -b “您的分支名称”

git 分支分支

git 拖拉源 "您的分支名称"

从母版分支向 dev 分支成功退出

enter image description here

我用了那个:

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 checkout -b <BRANCH-NAME> <REMOTE-NAME>/<BRANCH-NAME>

其它答案在我的良性案例中不适用于现代 Git 。 如果远程分支是新的, 您可能需要先拉一下, 但我还没有检查过这个案例 。

要克隆 Git 仓库, 需要 :

git clone <either ssh url /http url>

上述命令检查了所有分支,但只检查了master将初始化分支。 如果您想要检查其它分支, 请做 :

git checkout -t origin/future_branch (for example)

此命令检查远程分支, 您的本地分支名称将与远程分支相同 。

如果您想要在检查退出时覆盖您的本地分支名称 :

git checkout -t -b enhancement origin/future_branch

现在您的本地分支名称是enhancement,但您的远程分支名称是future_branch.

git fetch --all

将所有远程分支都带回您的本地

git checkout test

将您切换到测试分支