简体   繁体   English

git CMD 不显示所有分支

[英]git CMD Not Showing All Branches

I am extremely new to git.我对 git 非常陌生。

I am using Git CMD.我正在使用 Git CMD。

When I type git clone.... I am able to clone the repository successfully, but when I type git branch -a , it doesn't give me a list of all branches available.当我输入git clone....我能够成功克隆存储库,但是当我输入git branch -a时,它没有给我所有可用分支的列表。

What am I doing wrong?我究竟做错了什么?

My end goal is to use git cmd to switch branches.我的最终目标是使用git cmd来切换分支。

This is what happens:这就是发生的事情:

c:\users\username\projects>git branch -a c:\users\username\projects>git 分支 -a

fatal: not a git repository(or ay of the parent directories): .git致命:不是 git 存储库(或任何父目录):.git

Git is installed on a "per project" basis. Git 是按“每个项目”安装的。 So each project will have it's OWN GIT repository.所以每个项目都会有它自己的GIT存储库。 You need to be sure you are in the project directory you want to be in, and then issue your git commands IE:你需要确保你在你想要的项目目录中,然后发出你的git命令 IE:

c:\> cd c:\users\username\projects
c:\users\username\projects> cd my-project
c:\users\username\projects\my-project> git branch -a

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM