.gitignore pattern format ** doesn't work
But when I do a
git status in the terminal, It return to me this:
Untracked files: # (use "git add <file>..." to include in what will be committed) # # src/AVC/MediasBundle/Entity/CapturePhotoVideo.php~ # src/AVC/MediasBundle/Entity/CodeReconnaissanceVocale.php~ # src/AVC/MediasBundle/Entity/CodeTraduction.php~ # src/AVC/MediasBundle/Entity/DetailTransaction.php~ # src/AVC/MediasBundle/Entity/Langue.php~ # src/AVC/MediasBundle/Entity/Media.php~ # src/AVC/MediasBundle/Entity/MediaLangue.php~ # src/AVC/MediasBundle/Entity/Offre.php~ # src/AVC/MediasBundle/Entity/QualiteVideo.php~ # src/AVC/MediasBundle/Entity/SousTitre.php~ # src/AVC/MediasBundle/Entity/Transaction.php~ # web/images/logo_black.svg
Or each folder in
src/AVC/MediasBundle/Entity/....php~ shouldn’t appear …
But if in my .gitignore I replace le line
src/**/Entity/*.php~ by this line
src/AVC/MediasBundle/Entity/*.php~ everything works good !
Why doesn’t the pattern format
** work here?
2 Solutions collect form web for “.gitignore pattern format ** doesn't work”
The ignore pattern in your question works as expected for me with Git 2.1.0. I’m not sure why it isn’t working for you.
Your version of Git is quite old (the source code seems to have been released mid-2012). It is probably worth upgrading to the latest version that is available for your operating system and seeing if that fixes things.
I just don’t want to upload temporary files on my repository.
In this case I would advise a simpler pattern:
This very common ignore pattern simply ignores all files ending in
I just tested this in a test repo, and this works for me:
My guess would be that adding the extra directory with a double
* is causing some issues.