1

in my .gitignore file I have added '/vendor/'. Unfortunately when I run command git status, console shows me a lot of vendors files and dirs. How I can avoit it?

Ruben Lech
  • 125
  • 12
  • 2
    Having `/vendor/` in your .gitignore shouldn't be problem. Run `git rm -rf --cached vendor` first then run `git status` again to see if it goes away. I just suspect that you might have staged or committed it before by accident. – BentCoder Aug 21 '17 at 11:22
  • [How to make Git “forget” about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore?rq=1) – Veve Aug 21 '17 at 11:33
  • 1
    Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – phd Aug 21 '17 at 12:12
  • Did you commit your `.gitignore` file yet? If you haven't, `git status` will still show those files. – Jason Roman Aug 21 '17 at 13:50

3 Answers3

3

Having /vendor/ in your .gitignore shouldn't be problem. Run git rm -rf --cached vendor first then run git status again to see if it goes away. I just suspect that you might have staged or committed it before by accident.

lxg
  • 12,375
  • 12
  • 51
  • 73
BentCoder
  • 12,257
  • 22
  • 93
  • 165
-1

I assume vendor directory is in your git cloned repository, if so you need to rename the entry in .gitignore file as follow.

/vendors or just vendors works fine

ntshetty
  • 1,293
  • 9
  • 20
  • 1
    Well no. /vendor/ will work just fine. git works off of the repository location and knows nothing about the rest of your system. – Cerad Aug 21 '17 at 11:57
  • 1
    This answer is just plain wrong. Downvoted accordingly. – Cerad Aug 21 '17 at 22:36
-3

Use the relative path instead of absolute i.e. add vendor/ to .gitignore file instead of /vendor/

hspandher
  • 15,934
  • 2
  • 32
  • 45