Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github - Commit error after renaming package in android application: LibGit2Sharp.LockedFileException: The index is locked

After renaming package of an android application, I am facing a commit error as follows:

Showing user error Failed to create a new commit. LibGit2Sharp.LockedFileException: The index is locked. This might be due to a concurrent or crashed process

at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)

at LibGit2Sharp.Index.Replace(TreeChanges changes)

at LibGit2Sharp.Index.Replace(Commit commit, IEnumerable`1 paths, ExplicitPathsOptions explicitPathsOptions)

at LibGit2Sharp.Index.Replace(Commit commit)

at GitHub.ExclusiveRepositoryConnection.<>c__DisplayClass13.b__10()

at System.Reactive.Linq.ObservableImpl.Defer`1.Eval()

at System.Reactive.Linq.ObservableImpl.Defer`1._.Run()

Renaming package caused changes in 1) almost entire files of the android application and also 2) folder names of Git repository.

Does anybody have the same issue? Or am I missing something?

Any input will be greatly appreciated!

Regards,

like image 304
makeasy Avatar asked Jan 09 '16 02:01

makeasy


1 Answers

The problem is that there is already an index.lock file in the .got folder of your repository. Every time you create a commit, a check is made that this file does not already exist.

Fix this issue by running

On linux/unix/gitbash/cygwin,

rm -f .git/index.lock 

On Windows Command Prompt, try:

del .git\index.lock
like image 109
deborah-digges Avatar answered Nov 10 '22 16:11

deborah-digges