I set up an online project in the yii2 framework on my local and started maintaining the code using Git. A few days later I decided to ignore a few files & folders like "vendor, runtime and upload" folders. I have 3-5 git branches now. I also created a repository in Github website for saving my changes online. But, all the ignored files & directory are getting pushed to GitHub. The total directory size (excluding .git
directory) is around 632MB. The '.git' directory itself is 1.3 GB.
I don't want to push the ignored files and directories.
I used the following command to remove already added files & folders from Git.
git rm --cached <file>
git commit -m "to save the changes"
But when I push the files to the server, it still pushes stagged and ignored files & directories.
I want to permanently ignore the files & directories I added in the '.gitignore' file from all my Git branches and also want to push rest of the files in Git. Here is the copy of my Git ignore file. Every time I use the following command, it adds the ignored files as well.
git add --all *
The Git ignore file:
# windows thumbnail cache
Thumbs.db
# composer itself is not needed
composer.phar
# composer vendor dir
/protected/vendor
# runtime dir
/protected/frontend/runtime/
/protected/backend/runtime/
#tempfiles
*~
/assets/**
/uploads/*
*.log
@Drubio Here's the directory structure:
/assests
/uploads
/protected
/backend
/runtime
/<rest all the directory by default installed with yii2
/common
/frontend
/runtime
/<rest all the directory by default installed with yii2
/vendor
/console
/environment
/.git
<few files here on root>
.gitignore
.htaccess
Please help.
Thanks