是否有像 maven、gradle 这样的构建工具支持只构建暂存/提交的代码而不包括未暂存/未跟踪的文件。
基本上在开发过程中会出现一些情况,我想检查提交的包和未提交的包。虽然我可以实现两个不同的目录,但任何构建工具的这种灵 active 都会有很大帮助。
例如:假设我有一个 maven 项目,我修改并提交并将代码推送到 GIT Repo。后来我开始进一步开发。当我构建时,它构建包括所有文件,但我想知道是否有任何我可以跳过 maven pom.xml 中未暂存/未跟踪的文件以仅构建提交的文件。任何有助于实现此目的或任何其他构建工具的插件。
最佳答案
我认为git stash
为此派上用场:
Use
git stash
when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match theHEAD
commit.
关于java - 为 git 提交的代码构建 Maven,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36546427/