.gitignore file not working properly

Hi there,

I’ve been facing few issues working with git. I’m totally unable to exclude whole content from either /runtime or /vendor folders. Here’s how my .gitignore file looks:


# phpstorm project files

.idea


# netbeans project files

nbproject


# zend studio for eclipse project files

.buildpath

.project

.settings


# windows thumbnail cache

Thumbs.db


# composer vendor dir

/vendor

# cubrid install dir

/cubrid


# composer itself is not needed

composer.phar


# composer.lock in applications is ignored 


since it's automatically created by 


composer when application is installed

/apps/*/composer.lock


# Mac DS_Store Files

.DS_Store


# phpunit itself is not needed

phpunit.phar

# local phpunit config

/phpunit.xml


# ignore sub directory for dev installed 


apps and extensions

/apps

/extensions


#custom

/runtime/

/web

Any thoughts about what I’m missing?

I understand that nothing from here helped?

After you modify the .gitignore file you will need to update your cache file to stop tracking the files.

Run these commands to pull them from the cache: (the files will not be deleted)

git rm --cached /vendor

git rm --cached /runtime

If those directories are empty then .gitignore won’t work, there needs to be at least on file in the directory before git will obey your requests.

I tried running those commands, but it throws an error saying they are already outside of the repository and the directories keep being tracked thuough.

When you doing


/file

inside of .gitignore it will search /file near of .gitignore file. to ignore all runtime folders inside all project you need to assign


runtime/

instead of


/runtime/

Have already modified the .gitignore so here´s how it looks:


# phpstorm project files

.idea


# netbeans project files

nbproject


# zend studio for eclipse project files

.buildpath

.project

.settings


# windows thumbnail cache

Thumbs.db


# composer vendor dir

vendor/

# cubrid install dir

/cubrid


# composer itself is not needed

composer.phar


# composer.lock in applications is ignored since it's automatically created by composer when application is installed

/apps/*/composer.lock


# Mac DS_Store Files

.DS_Store


# phpunit itself is not needed

phpunit.phar

# local phpunit config

/phpunit.xml


# ignore sub directory for dev installed apps and extensions

/apps

/extensions


#custom

runtime/

web/

However the files keep tracked…

Simply rename the folders and see what Git has to say.

You can then name them back again.

Sorry for the late answer, what folders dou you mean?

Thanks

Runtime and vendor, obviously.

Don´t know why but after a lot of tries it worked. Thanks!