Exclude folder in .gitignore with long path using git (GitHub for Windows) -
say have folder
/project1/superlong/path/to/the/folder/i/want/to/exclude/in/my/gitignore/file/
and have same folder in several projects, each project have different first folder in superlong path.
let me show i'm talking about: /project1/superlong/path/to/the/folder/i/want/to/exclude/in/my/gitignore/file/
/project2/superlong/path/to/the/folder/i/want/to/exclude/in/my/gitignore/file/
/project3/superlong/path/to/the/folder/i/want/to/exclude/in/my/gitignore/file/
etc
so in .gitignore want singel simple line, - 2 last folder know unique in entire folder structure:
gitignore/file/
i've tried in .gitignore file doesn't work. missing asterisk or something? i've consulted manual pages manual super not intuitive superbad examples.
update: apparently current version of github windows uses older version of git lacks support **
. see comments below more info.
looking @ other posts, seems though **
bash-specific pattern. if have same depth of folders use this:
*/*/*/*/*/*/*/*/*/*/*/*/gitignore/file/
i've tested in git source control plugin vs , seems work. it's not pretty though! (i'm basing on example of 12 levels of path above /gitignore
)
this article states .gitignore
doesn't support **
directly. advocates placing .gitignore
file (in case) each of gitignore
folders, matching file/
. not ideal either possibly nicer pattern above.
update:
as long you're matching on single folder, should work, regardless of in folder structure:
gitignore/
Comments
Post a Comment