git - Git 已安装,但 .git 目录不存在,所以我无法配置它
问题描述
.git
文件夹不存在
上个月相同的配置有 .git 目录
ls -la
total 97
drwxr-xr-x 24 root root 4096 Apr 19 09:22 .
drwxr-xr-x 24 root root 4096 Apr 19 09:22 ..
drwxr-xr-x 2 root root 4096 Apr 16 05:01 bin
drwxr-xr-x 4 root root 1024 Apr 16 05:03 boot
drwxr-xr-x 19 root root 3980 May 15 03:42 dev
drwxr-xr-x 92 root root 4096 May 17 02:58 etc
drwxr-xr-x 3 root root 4096 Apr 16 05:03 home
lrwxrwxrwx 1 root root 32 Apr 16 04:57 initrd.img -> boot/initrd.img-4.4.0-87-generic
drwxr-xr-x 22 root root 4096 Apr 16 05:01 lib
drwxr-xr-x 2 root root 4096 Apr 16 04:57 lib64
drwx------ 2 root root 16384 Apr 16 04:57 lost+found
drwxr-xr-x 4 root root 4096 Apr 16 04:57 media
drwxr-xr-x 2 root root 4096 Aug 1 2017 mnt
drwxr-xr-x 2 root root 4096 Aug 1 2017 opt
dr-xr-xr-x 186 root root 0 May 15 03:42 proc
drwxr-xr-x 3 root root 4096 Apr 19 09:22 pub
drwx------ 3 root root 4096 May 17 04:39 root
drwxr-xr-x 25 root root 920 May 17 02:58 run
drwxr-xr-x 2 root root 12288 Apr 16 05:03 sbin
drwxr-xr-x 2 root root 4096 Apr 29 2017 snap
drwxr-xr-x 2 root root 4096 Aug 1 2017 srv
dr-xr-xr-x 13 root root 0 May 17 02:59 sys
drwxrwxrwt 9 root root 4096 May 17 05:39 tmp
drwxr-xr-x 10 root root 4096 Apr 16 04:57 usr
drwxr-xr-x 14 root root 4096 Apr 16 05:02 var
lrwxrwxrwx 1 root root 29 Apr 16 04:57 vmlinuz -> boot/vmlinuz-4.4.0-87-generic
无法创建文件夹
解决方案
如果您正在谈论该.gitconfig
文件,那么它应该位于您的主目录下。该文件包含用户特定的配置。
当您运行时,该.git
文件夹会在存储库中创建git init
。它包含项目版本控制所需的所有信息。它还包含有关提交、远程仓库、地址等的信息。
请参阅文档:
此命令创建一个空的 Git 存储库 - 基本上是一个包含、、和模板文件
.git
的子目录的目录。还会创建一个引用 master 分支的 HEAD的初始文件。objects
refs/heads
refs/tags
HEAD
推荐阅读
- javascript - 我们如何从赛普拉斯的一个文件夹中读取多个文件?
- swiftui - 相对于另一个居中视图定位视图
- node.js - Node.js API 服务器 - 无法构建
- sql - 条件非空约束
- javascript - JS 构造函数正在输出未定义的值
- java - JavaFX:ObservableListWrapper 无法转换为 TableView 中的类
- jquery - MVC 中的 Jquery ajax POST 调用 - 包括 IIS 中托管的应用程序名称
- javascript - 如何在 php 和 mysql 上实现数据表
- angular - “UpdateEmployeeComponent”类型上不存在属性“已提交”
- android - 在 Glide 库中加载字符串本地地址