Open chrisbenincasa opened 6 years ago
Here is another example, this time using a wildcard for filename:
> tree -a minimal.g8/
minimal.g8/
└── src
└── main
└── g8
├── .gitignore
├── default.properties
├── deploy
│ └── .gitkeep
└── src
└── main
└── resources
└── test.conf
7 directories, 4 files
.gitignore
contents in scaffold:deploy/*.json
> g8 file://minimal.g8 --name=minimal
> tree -a minimal/
minimal/
├── .gitignore
└── src
└── main
└── resources
└── test.conf
3 directories, 2 files
git check-files
result in generated project:✗ git check-ignore --verbose deploy/.gitkeep
✗ git check-ignore --verbose deploy/service.json
.gitignore:1:deploy/*.json deploy/service.json
I also verified the two ignores using JGit:
@ import org.eclipse.jgit.ignore.FastIgnoreRule
import org.eclipse.jgit.ignore.FastIgnoreRule
@ val rule = new Fast
FastIgnoreRule
@ val rule = new FastIgnoreRule("deploy/*.json")
rule: FastIgnoreRule = deploy/*.json
@ rule.isMatch("deploy/.gitkeep", false)
res3: Boolean = false
@ rule.isMatch("deploy/service.json", false)
res4: Boolean = true
@ val rule2 = new FastIgnoreRule("**/resources/build.properties")
rule2: FastIgnoreRule = **/resources/build.properties
@ rule2.isMatch("src/main/resources/build.properties", false)
res6: Boolean = true
@ rule2.isMatch("src/main/resources/test.conf", false)
res7: Boolean = false
Using the latest
giter8
from brew (0.10.0), some file patterns in.gitignore
are ignored bygiter8
that wouldn't be ignored bygit
.Here is an example:
Template structure:
.gitignore
contents in scaffold:Generated directory:
Note that
src/main/resources/test.conf
is missing. We can verify that "normal" git would not ignore these files withgit check-ignore
: