jonpugh / composer-git-build
本包的最新版本(dev-master)没有提供许可证信息。
将供应商和其他忽略的文件添加到git中的命令,
dev-master
2018-03-08 21:37 UTC
Requires
- composer-plugin-api: ^1.1
This package is auto-updated.
Last update: 2024-09-14 05:52:02 UTC
README
该工具的目标是尽可能简化将忽略的目录提交到git的过程。
也被称为“工件构建”,此命令将
- 如果指定了--build-dir,则创建一个新的仓库并添加您的git远程仓库。
- 从当前分支拉取最新更改。
- 自动修改您的.gitignore文件,允许添加供应商和其他代码。
- 提交所有不再被忽略的新代码。
- 创建一个新的分支或标签。
- 将分支或标签推送到远程仓库。
此插件代码大量借鉴自Acquia的BLT命令deploy
命令。
用法
-
添加到您的composer项目或全局
composer require jonpugh/composer-git-build
-or-
composer global require jonpugh/composer-git-build
-
添加到您的.gitignore文件
## IGNORED IN GIT BUILD: ## # Items below this line will retained in artifacts built with the `composer git-build` command.
-
添加到您的composer.json文件
{ "config": { "git.remotes": [ "git@github.com:organization/build-repo.git", "svn@acquia.com" ] } }
新构建的仓库将自动添加这些远程仓库,并将标签或分支推送到它们。
-
运行
composer git-build
Usage: git-build [options] Options: -b, --build-dir[=BUILD-DIR] Directory to create the git artifact. Defaults to the composer working-dir option. --branch=BRANCH Branch to create. --tag=TAG Tag to create. -m, --commit-msg=COMMIT-MSG Commit message to use. --ignore-dirty Allow committing even if git working copy is dirty (has modified files). --dry-run Build and commit to the repository but do not push.
感谢
- @acquia/blt团队为启动该工具。
- @generalredneck,他在康奈尔DrupalCamp的session中分享了他的.gitignore技巧:https://www.youtube.com/watch?v=WMd60xmQvlY&feature=youtu.be