4

When I try to switch to the master branch in eclipse, I get an error:

Branch failed Cannot lock /home/pal/workspace/pal-prod/.git/index

Any ideas what causes this? I'm having trouble searching for that error (nothing similar came up).

I'm not sure if my VM has size issues, or why it can't lock that.

I am currently in branch Bom. Eclipse says pal-prod [pal-prod Bom up arror 2] in the Project Explorer. I recently pushed changes through the linux command line since I have been having error messages in eclipse when I try to push, commit, etc.

Thanks, Mich

Michele
  • 3,617
  • 12
  • 47
  • 81
  • The back-story: http://stackoverflow.com/questions/30651593/creating-new-git-branch-in-eclipse – Nick Volynkin Jun 08 '15 at 17:00
  • Try these solutions: http://stackoverflow.com/questions/6656619/git-and-nasty-error-cannot-lock-existing-info-refs-fatal – Nick Volynkin Jun 08 '15 at 17:03
  • I'm looking at that link and when I do lsof it lists a ton of files. Are we looking for anything special? I tried lsof | grep lock, and it lists /proc/146/cwd, root, exe, fd, (those were permission denied) kblockd, and also /home/pal/.local/share/zeitgeist/fts.index/flintlock, which was cat. – Michele Jun 08 '15 at 17:50

1 Answers1

12

Read this issue and try the solution if the problem description is the same as your :

Solution is to delete index.lock if it exist (when eclipse is shutdown and no other process interact with the repo)

.lock files are created when a process use the repository, so my guess would be that a .lock file wasn't deleted properly and Egit still think it's busy.

flafoux
  • 2,080
  • 1
  • 12
  • 13
  • How do I tell if another process is interacting with the repo? I exited eclipse and see that .git/index.lock exists. When I did ps -ef | grep git, I'm seeing git commit -a, .git/COMMIT_EDITMSG are out there. – Michele Jun 08 '15 at 17:47
  • I got it to work. I deleted index.lock, and kill -9 the git processes that were hanging. After that, I did a git status and saw I needed to commit some files, and when I did that, I realized that I did git commit -a which causes it to open the editor to have a commit message, with no instructions how to exit it gracefully. This time after killing the processes and removing the lock file, I did git commit -a -m 'message', and didn't have to deal with the editor. (no, :q didn't exit gracefully) – Michele Jun 08 '15 at 18:33