-3

I have a problem with Phpstorm (2017.3.2) and gitlab I commited and pushed the bower_components folder and would like to remove it, but I can't. I fif git rm -r --cached ./public/bower_components, the folders/files looked red (like files that are not synced with git, that's good), when I try to commit, they looks in grey (like when you delete a files from git, that's good), but when I commit/push, I have this error message.

    Commit failed with error
    0 files committed, 11 files failed to commit: remove bower folder
    On branch master
    Your branch is up-to-date with 'origin/master'.

    nothing to commit, working tree clean

I also have another problem related to phpstorm, more than git. I want to exclude the /public/node_modules and /public/semantic folders so I marked these folders as Excluded (orange folder in Phpstorm) but they keep appearing in the commit window. I also tried to add them to .gitignore file but still appearing.

The vendorforlder is not showing though (I created the project some weeks ago with the symfony command composer create-project symfony/website-skeleton my-project and I don't remember what I did at that time to exclude the vendor folders. )

Thanks in advance for your answers.

Etshy
  • 870
  • 7
  • 25
  • If you have two question, ask [two questions](https://meta.stackexchange.com/questions/222735/can-i-ask-only-one-question-per-post). What have you tried to solve your problem so far? What research have you done yourself yet? What steps did you exactly take to get where you are? Can you be more clear about what you want to archive? Can you describe what is going wrong, what output you are getting and what else you are expecting? If you want to use a guide about [how to ask a good question](https://stackoverflow.com/help/how-to-ask) – LinFelix Jan 28 '18 at 02:34
  • What I did: installed the symfony start apps with composer, install some of frontend packages with bower and npm. Then i first commited al this, and included bower folder by mistake in the commit, so I want to remove it from my gitlab repo. So I researched how to remove folder from git, and founnd the `git rm -r --cached` command, but it doesn't seems to be working, with the output I pasted in the phpstorm git log. So I expected the files to be removed from the git repo, but the commit doesn't work. Sorry for the bad question, I thought it was clear enough. – Etshy Jan 28 '18 at 10:00

1 Answers1

0

For first question, you could have search a bit more : Git: Remove committed file after push

For the second one, you're confused between PhpStorm exclusion, which only remove folders from PhpStorm file indexing ; and Git exclusion, which works thanks to the .gitignore file in your project folder, which should already contains symfony gitignore lines :

# .gitignore
###> symfony/framework-bundle ###
.env
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

So just add the following :

/public/node_modules/
/public/semantic_folders/

Please note that your node_modules should NOT be in the public folder

Pete_Gore
  • 594
  • 1
  • 5
  • 20
  • I already added the folders in .gitignore and as I said it didn't worked. I even tried to add the folders in the ignored files in phpstorm settings, nothing changed either. For the first question, I didn't event find the SO thread you linked >.> And for the node_modules folder, the thing is some of the front end library I use are on npm, so when I install them I have the whole node_modules in the public folder. If there is a way to change that I'm happy to learn how. – Etshy Jan 28 '18 at 09:48
  • Yeah there were already pushed. I tried the link you pasted but It didn't worked either (maybe cause I already added the folder in gitignore before that >.> Juste realised that later), So as it's just the bower components folder I deleted it, comit/push and then reinstall (I added the folder in gitignore and it wasn't in the commit screen after that) – Etshy Jan 28 '18 at 17:33