【Git】fatal: Not a git repository (or any of the parent directories): .git

谭京
2023-12-01

登陆git bash窗口,查看git status报错如下:

$ git status

fatal: Not a git repository (or any of the parent directories): .git

 

skyman@SKYMAN-CF7E3587 ~

$ git checkout master

fatal: Not a git repository (or any of the parent directories): .git

 

skyman@SKYMAN-CF7E3587 ~

用ls查看下当前目录吧,看到在根目录下,那么进去namanu目录去看看。

$ ls

AppData           Favorites       NTUSER.DAT  SendTo          _viminfo     manual56                    wc

Application Data  IECompatCache   NetHood     Templates       admovie.jpg  ntuser.dat.LOG              ??????????????????

CMB               IETldCache      PrintHood   UserData        client.log   ntuser.ini                  ??????

Contacts          Local Settings  PrivacIE    VirtualBox VMs  extensions   ntuserdirect_MyManager.dat

Cookies           My Documents    Recent      WINDOWS         helloworld   test_git

 

进入mana目录

$ cd manual56/

 

skyman@SKYMAN-CF7E3587 ~/manual56 (master)

然后执行git命令

$ git status

# On branch master

nothing to commit (working directory clean)

 

skyman@SKYMAN-CF7E3587 ~/manual56 (master)

 

OK,搞定了,原来登陆不算的,需要进入master目录,才能执行各种git操作命令,一时给忘记了,看来整个git流程还没有完全彻底掌握透彻,需要继续加油。

 再去执行git log查看最近master信息

$ git log

commit 3e96f9090fd8edb147cf23e428b64a3e49f14447

Author: mchdbagh <mchdba@yahoo.com>

Date:   Thu Sep 26 00:32:54 2013 +0800

 

    Test chanage

 

commit 9a8976f5979b15d4ef1c3768908a7a180e701bf5

Author: mchdbagh <mchdba@yahoo.com>

Date:   Thu Sep 26 00:32:17 2013 +0800

 

    Test chanage

 

commit e754e684c2c35c45d4df2517701eff0575efcd96

Author: mchdbagh <mchdba@yahoo.com>

Date:   Wed Sep 25 00:33:22 2013 +0800

 

    添加 17.5章节部分内容初稿

 

commit 3630b10aa84a65024602d60f70756384a62df757

 类似资料: