Please look at the screenshot.First,I updated a file and wanted to add it to the stage,but failed.It said the path was not right .Before adding it ,I had checked the path which was right.
Asked
Active
Viewed 77 times
1 Answers
2
It doesn't say the path isn't right, it says it can't create a lock. If no other git instance is running, you could try deleting the lock manually.

choroba
- 231,213
- 25
- 204
- 289
-
I wanted to add it to ../learngit/ .What's the matter wih the path '../learngit/git..' ? – Xiaolong Oct 21 '15 at 12:49
-
@Xiaolong `'../learngit/git..'` files/folders cannot have a `..` suffix, but that is not the problem in your case, read the error message git throws – Tim Oct 21 '15 at 12:51
-
@Xiaolong: Git creates a lock file when touching the repository. Normally, the lock file would be removed on a successful end of the operation, but in this case, something went wrong, so the lock file is still there. Just `rm .git/index.lock`. – choroba Oct 21 '15 at 12:51