【问题标题】:Grunt; Warning: uncommitted changes in working directory咕哝;警告:工作目录中未提交的更改
【发布时间】:2014-04-15 15:40:37
【问题描述】:

我正在尝试设置 Grunt 以提交到 Github 上的存储库。

在 Gruntjs 我有;

 buildcontrol: {
            options: {
                dir: 'dist',
                commit: true,
                push: true,
                message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
            },
            pages: {
                options: {
                    remote: 'git@github.com:numediaweb/test.git',
                    branch: 'gh-pages'
                }
            },
            local: {
                options: {
                    remote: '../',
                    branch: 'build'
                }
            }
        },

但是当我执行命令 grunt buildcontrol:pages 时,我收到了这个警告;

Running "buildcontrol:pages" (buildcontrol) task
Warning: There are uncommitted changes in your working directory.
Please commit changes to the main project before you commit to
the built code.

我关注了this tutorialthis one,但无法正常工作。我错过了什么吗?

【问题讨论】:

    标签: git repository gruntjs npm githooks


    【解决方案1】:

    【讨论】:

    • 这不是关于 Grunt 构建控制,说实话,这对我来说都是希腊语 :( 我使用 yeoman 创建一个应用程序,我安装了 grunt-build-control,我执行了 git init在创建“myApp/.git”的主目录中(不在“myApp/app”中)..运行 grunt build 填充“myApp/dist”目录,但后来我迷路了!关于如何将我的整个应用程序部署到 beanstalkapp 并设置 grunt 来构建/提交和推送我的整个应用程序,是否有任何简单的步骤(对于傻瓜)?谢谢
    【解决方案2】:

    查看connectCommits 属性:https://github.com/robwierzbowski/grunt-build-control#connectcommits

    我添加它是为了防止构建和推送无法追溯到父项目提交的代码。如果您在项目开始时进行大量黑客攻击,您可以将其设置为 false,但是一旦您启动并运行,我认为将其保留是个好主意。

    【讨论】:

      猜你喜欢
      • 2013-11-20
      • 1970-01-01
      • 2022-12-04
      • 2014-01-24
      • 2020-07-03
      • 2011-07-06
      • 1970-01-01
      • 1970-01-01
      • 2016-05-22
      相关资源
      最近更新 更多