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

 

第一次用git,遇到这个错误提示,原来是这样的:

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

This tells you that the directory you're in is not a git repository. Before you can add remote servers, commit things and so you must have a git repository created.

In a git repository there's a directory (which can be hidden) named .git. It contains metadata on the repository and all the data regarding the checked files.

To create it type git init in the directory you wish to have a git repository. Then you could add remote servers and perform operations on it.

 

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

  出现这个问题后,发现其实是在本系统下没有找到一个.git这样的目录,所以在终端下使用git --help命令,显示了其主要的一些命令参数,发现一个参数是init:

2.init Create an empty git repository or reinitialize an existing one

  执行git init之后,然后再重新编译,这个问题就被解决了。这里要注意的一点是,和svn不一样,svn不需要自己使用命令来创建自己的资源库,而git需要自己使用命令手动创建,具体.git的位置和你在哪个目录下执行命令有关。

 

 

  • 6
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值