ocroquette's technical Blog

Icon

TTT (tips, tricks, tools)

git: failed to lock

Recently I had this error message “failed to lock” while trying to push some changes to a remote Git repository.

After some time Googling with no success and then troubleshooting, I realised I was trying to push to branch called “a/b” while the branch “a” existed. This is obviously not supported in Git, since having a branch “a” requires “.git/refs/heads/a” to be a file (containing the current branch head), while having a branch “a/b” requires “.git/refs/head/a” to be a directory.

Advertisement

Filed under: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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

Follow

Get every new post delivered to your Inbox.