从特定文件夹为 gh 页面创建分支,以仅签入文件

creating branch for gh pages from a particular folder, to check in only files

我有 java 个项目,它在目录路径 main_project/target/cucumber_output/

中生成 html 个文件

我只需要签入这些 html 个文件,仅此而已。但是当我在 main_project 上创建 gh-pages 分支时,它也会签入 target/cucumber_output 文件夹。

我只需要签入 cucumber_out 下的所有文件,怎么办?

提前致谢。

此致, 维克拉姆

您需要创建一个 .gitignore 文件并添加除 cucumber_output 文件夹之外的所有文件。您的 .gitignore 文件应如下所示:

/*
!main_project/target/cucumber_output
!.gitignore

An optional prefix ! which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources.

可能与 this & this 重复!

https://srackham.wordpress.com/2014/12/14/publishing-a-project-website-to-github-pages/

这解释了我想要实现的要求。

我还提到了根据

忽略一个子目录

.gitignore exclude folder but include specific subfolder