git commit – failed – “git rename from ‘.git/index.lock’ to ‘.git/index’ failed”

Background

Issued git commit, but failing.

Error

Error Image

unableToWriteNewIndexFile.20190329.1005PM

Error Message


rename from '.git/index.lock' to '.git/index' failed. Should I try again? (y/n) y

 

TroubleShooting

Accessed the .git folder and noticed that a file named index already exists.

git.folder.20190329.0950PM

That file’s existence is likely why git commit is unable to rename index.lock to index.

 

Remediation

Rename the existing index file to something out of the way such as index.[TS] that is index.20190329.1010PM

Re-Issue commit command.

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s