I am aware that there are similar issues about git relating to the \'unable to unlink\' warning, but I have not been able to use them.
The main difference is that th
I encountered this error and I think the issue was that I had 'run as admin' when I started Eclipse and created the files, therefore they were owned by Admin (noticed by running 'ls -la' on the folder). When I later tried to stash the files, it didn't let me ('unable to unlink files' and all that). Doing a chmod on the files was the fix for me.
git gc worked for me (in a new tab). Was getting this with every rebase. Thanks http://www.saintsatplay.com/blog/2016/02/dealing-with-git-unlink-file-errors#.W4WWNZMzZZJ
In my case, my Windows directory is under the Dropbox folder. It is not a Git-specific issue. When a file (in this case, the lock file) has just been created, it takes Dropbox another second to do the synchronization. During that time, the file is in use by Dropbox, and any 3rd party program (in this case, Git) cannot delete the file.
My solution is to quit Dropbox and therefore avoiding the behind-the-scenes magic of Dropbox's file synch.
I ran into this problem whenever running "git repack" or "git gc" on my OS X machines, even when running git with admin privileges, and I finally solved it after coming across this page: http://hints.macworld.com/comment.php?mode=view&cid=1734
The fix is to open a terminal, go to your git repo, cd into the .git folder, and then do:
chflags -R nouchg *
If that was the issue, then after that, your git commands will work as normal.
I just had to switch user from ubuntu to my actual user name that I'd first done stuff under. That fixed it.
on terminal on mac i just do this
sudo git checkout . ( to clean up everything )
and then
sudo git pull origin