我无法看到我在GIT上的分支

时间:2016-02-22 19:08:35

标签: git

我创建了一个GIT分支。

我正在看分支(例如C:\ Branch(myBranch))创建新分支后,我不再看到我所在的分支了。

git branch new_branch

我只看到C:\ branch。

我希望看到c:\branch (new_branch)

当我这样做的时候 git status显示“on new_branch”

提前谢谢

1 个答案:

答案 0 :(得分:1)

首先,当您执行git branch时,您没有切换到新分支。

git checkout -b <branch_name>

将创建并切换到您的新分支。

在Windows上如果使用命令行(cmd),则必须手动设置。 [这里]是一个如何做的例子。

更好的方法是使用git bash。只需右键单击您的文件夹,然后使用菜单中的git Bash here

git bash有一个内置提示符,显示分支名称。

enter image description here

enter image description here