I'm using Laravel and the Github program for subversions. In my .gitignore file i type:
/vendor
My project structure looks like this:
Root
app
bootstrap
public
vendor
And it's all the files in vendor i want to ignore in git. Most of the files works to ignore there with typing /vendor in my .gitignore, but some files don't.
The files that doesn't work are autoload.php - vendor/autoload.php
And files in vendor/composer
- like:
autoload_classmap.php
autoload_namespaces.php
autoload_real.php
ClassLoader.php
installed.json
What am i doing wrong in my .gitignore file?
gitignore file is usually placed in the repository's root directory. However, you can create multiple . gitignore files in different subdirectories in your repository.
gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Generally, this is placed in the root folder of the repository, and that's what I recommend. However, you can put it in any folder in the repository and you can also have multiple .
gitignore ignores only untracked files. Your files are marked as modified - meaning they were committed in the past, and git now tracks them. To ignore them, you first need to delete them, git rm them, commit and then ignore them.
After adding vendor folder in gitignore did you clear the git cache
git rm -r --cached vendor
git add .
git commit -m ".gitignore"
This will remove vendor folder completely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With