0

I'm using SourceTree, and when I try to checkout from one branch to another, I've got the following error message :

warning: unable to unlink sf2/web/bundles/mybundle: Permission denied
fatal: cannot create directory at 'sf2/web/bundles/mybundle': Permission denied

Though, on both branches, the folders in sf2/web/bundles/ are ignored, since many commits, as you can see in my .gitignore :

/sf2/web/bundles/*

That's pretty normal I guess, I'm on Windows, symlinks are sh*t. As a workaround, I can remove the folder and then checkout, but that's not so great.

It seems that, because I commited this folder/symlink some times at the begining, it now has to redo all the modifications step by step, including the ignored folders ?!

EDIT : I confirm it's creating this folder, an old version of it, even if it's supposed to be ignored now. And if I remove this folder, it's showing the few old files inside as working copy changes...

nwellnhof
  • 32,319
  • 7
  • 89
  • 113
Bonswouar
  • 1,521
  • 2
  • 17
  • 37

1 Answers1

0

Finally found the solution here :

Applying .gitignore to committed files

It's apparently because some files inside has been commited one time, so they are in the repo.

If I understand it right, that means it's very important to modify the .gitignore before commiting any file inside, otherwise it can be a mess !

Community
  • 1
  • 1
Bonswouar
  • 1,521
  • 2
  • 17
  • 37
  • 2
    `.gitignore` prevents the accidental adding of the ignored files. it does not affect already added files. – mnagel Sep 12 '13 at 09:57