解决方案:删除.git/index.lock文件
git add报错:fatal: Unable to create ‘E:/Blog/blogRoot/.git/index.lock’: File exists.
1 | lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src) |
解决方案:删除.git/index.lock文件
删除E:/Blog/blogRoot/.git/index.lock文件即可1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)
$ rm E:/Blog/blogRoot/.git/index.lock
lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)
$ git status
On branch src
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: .gitignore
modified: source/tools/Tools2.html
modified: source/tools/index.md
no changes added to commit (use "git add" and/or "git commit -a")
lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)
$ git add .
lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)
$ git status
On branch src
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: .gitignore
modified: source/tools/Tools2.html
modified: source/tools/index.md
lan@DESKTOP-8ISAT6B MINGW64 /e/Blog/blogRoot (src)