Git Checkout没有在IntelliJ中显示新文件

时间:2017-02-03 18:11:43

标签: git intellij-idea

我的朋友创建了一个新分支。我们称之为“branch2”。我现在在掌握。我在Bash中键入了git checkout branch2。然后我输入git pull

我收到以下消息:

Unpacking objects: 100% (28/28), done.
From https://bitbucket.org/***/***
 * [new branch]      Parse_T1   -> origin/Parse_T1
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> Parse_T1

我不想破坏任何东西或合并任何东西。我只想切换到该分支,并在IntelliJ中查看更新的文件。我该怎么办?呃,CLI ......这就是我爱Mercurial的原因。

1 个答案:

答案 0 :(得分:1)

首先摆脱当前分支中任何未提交的更改。然后执行以下操作。

  • 您应该先做&#39; git fetch&#39;。现在只有您的本地存储库知道任何推入源的新分支。
  • 然后尝试&#39; git checkout branch2&#39; 。它会创建一个名为&#39; branch2&#39;的 本地 分支。其中包含origin / branch2的最新更改。并且您将自动切换到local / branch2。 :))