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.
1 Answer
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.
3 Comments
Xiaolong
I wanted to add it to ../learngit/ .What's the matter wih the path '../learngit/git..' ?
Tim
@Xiaolong
'../learngit/git..' files/folders cannot have a .. suffix, but that is not the problem in your case, read the error message git throwschoroba
@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.