Symfony3 and .gitignore - gitignore

I've just tried cloning a Symfony3 project from github and realised it doesn't include /bin/ (as this was not required in Symfony2).
I have now updated my .gitignore to take out the /bin/ and /build/ directories to avoid this happening in future. Are there any other modifications that I'm missing that we should be making to a 'standard' Symfony3 .gitignore file?
My current content is as follows now:
/app/config/parameters.yml
/composer.phar
/vendor/
/web/bundles/
/var/
!var/cache/.gitkeep
!var/logs/.gitkeep
!var/sessions/.gitkeep
/phpunit.xml
Removed entries:
/bin/
/build/

this is a file that i used in a project from which i pulled in differents computers and untill now no problems, just pull and composer commands etc.
Hope it helps [i know is not perfect, any improves suggested are welcome]
/app/config/parameters.yml<br>
/build/<br>
/phpunit.xml<br>
/var/*<br>
!/var/cache<br>
/var/cache/*<br>
!var/cache/.gitkeep<br>
!/var/logs<br>
/var/logs/*<br>
!var/logs/.gitkeep<br>
!/var/sessions<br>
/var/sessions/*<br>
!var/sessions/.gitkeep<br>
!var/SymfonyRequirements.php<br>
/vendor/<br>
/web/bundles/<br>

Related

Should I add .parcel-cache in .gitignore? [duplicate]

What is the .cache folder in parcel-bundler? Is it necessary to push the .cache folder to Github ?
The .cache folder (or .parcel-cache in parcel v2) stores information about your project when parcel builds it, so that when it rebuilds, it doesn't have to re-parse and re-analyze everything from scratch. It's a key reason why parcel can be so fast in development mode. I think committing it to git would be a bad idea - it would add a large number of (unnecessary) changes to your commit history, and it could easily get out-of-sync with the code that generated it.
From this article:
Be sure to add .cache and dist to your .gitignore file to prevent
committing these folders to Git. The .cache folder is used by Parcel
as a temporary cache directory when building your app for development
and production.
A slight update on this answer, although it is practically the same response, would be that the command you now need to enter for parcel#^2.0.0-beta.1 is:
.parcel-cache
Add this to your .gitignore file and all the Blobs will be removed from your Untracked listed of files when you hit git status again.
Thank you for helping me resolve this issue!
no it is not necessary to add parcel-cache in git. one should add parcel-cache in git-ignore because parcel-cache is the space taken by parcel during production building its a binary files .This can be made again after deleting cache with a command npm run build

Ignoring files under config folder of codeigniter using github not working

I am using codeigniter framework to develope simple application. I want to push my code to github repo. While publishing my code to repo i want to ignore set of files in config folder such as config.php, database.php etc. I have downloaded codeigniter 3.1.11 from official website. I have been using following conditions inside my .gitignore file but none of them are working for me. I have tried all possible combinations of below conditions.
/application/config/
/application/config/*
/application/config/*.php
/application/config/database.php
/application/config/config.php
application/config/
application/config/*
application/config/*.php
application/config/database.php
application/config/config.php
config/config.php
config/*
/config/*.php
*/config
Whenever i change my config file for localhost setup and check the status it displays config file has been modified, and changes ready to be staged.
Help me to get throught this problem. I have tried all the possible options over the internet as well but none of them are working.
First, whenever a .gitignore set of rule does not work for a given file, check why with:
git check-ignore -v -- /path/to/file/which/should/be/ignored
Second, it is easier to put a .gitignore in the config folder itself, and list the files you don't want.
Third, for any file you want to be ignored, double-check they are not already tracked:
git rm --cached file_to_ignore

Git add is ignoring certain files even when .gitignore does not exist

I am facing a rather strange issue with my git working folders. Here's the summary:
I previously had a local git repo with a .gitignore file that ignored certain files/folders.
I deleted the repo (.git folder) and also the .gitignore file
Then I initialized a new one with git init in the same folder. Now when I do a "git add .", the previous ignore pattern is retained for some reason.
Even stranger,this happens with any new project following the same folder structure no matter where I place the project on my computer.
I tried deleting and recreating the files multiple times. I even created a new .gitignore file with a different pattern. It does not seem to have an effect except when it is set to ignore everything (with just * in the file)
My guess is that the .gitignore pattern I deleted is somewhere saved that I dont know the location of. If anyone has faced a similar issue or know what I could be missing, I'd love to know.
I am still new to git. Sorry if this is something very obvious that I have missed out on.
UPDATE:
I still have not found the reason for this behaviour but managed to reset everything by doing 'git add --force .' in the directory and then deleting the repo. Now I initialized a new repo that works as expected.

yii2 vendor and some files are missing from github

I have set up a new repo on github and pushed yii2 advanced template. Now i realized that some folders/files are missing from github like vendor and backend/web/index.php.
Anyone have idea why this is happening, i also checked my local git setup there files are present.
Check out the installation guide.
Running composer install is what creates the vendor folder, while running init creates those index.php files.
I have found that its happening because of .gitignore file. i removed it and its working fine for me.
It's quite simple idea behind missing these files, they are called ...-local.php, because their content can vary for different developers or production conditions. All you have to do before upload yii2 to the github, check the /environments directory, it includes templates for the local files, so after yii2 project is copied from the github, they will be generated by ./yii init.
Step-by-step, what should be done:
Configure files in /environments/dev and /environments/prod (for production). Most likely, if you don't change the yii2 project file structure or touch any of the /config files, you don't need to adapt them.
Update /environments/index.php, if you have updated /environments files
Upload the project to GitHub
Clone the project and run composer install to install dependencies
And finally run ./yii init from the root folder. You will see that ...-local.php files are now generated in certain directories the same way as they are configured in the environments.
More detailed information about this topic: https://www.yiiframework.com/extension/yiisoft/yii2-app-advanced/doc/guide/2.0/en/structure-environments

important files are not in list , all some files go in untract files list?

I am using a Git Repository to manage my project,
Now when i try to commit i see there are some impoertant file like content/image , scripts , etc files in untrack files
Why?
Is there any way to resolve this?
Regards,
vinit
You have to use "git add [wildcard or directory or file(s)]" first to add your files to the versioning system GIT. Manual page is here: https://www.kernel.org/pub/software/scm/git/docs/git-add.html
And the git book is worth a read.
Also I liked gitready very much.
Happy coding
If your Git repo has been initialized on GitHub (and then cloned), it is likely to come with a .gitignore (as well as a README.md, and even a LICENSE file).
Check if those files aren't ignored by the rules in the .gitignore.
You can do that with:
git check-ignore -v scripts
You can edit that file to remove the rules you don't want, then a git add . will add:
the modified .gitignore files
the files that were previously ignored.