咕噜;警告:工作目录中未提交的更改

时间:2014-03-11 20:15:29

标签: git repository gruntjs npm githooks

我试图设置一个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,但无法让它发挥作用..我错过了什么吗?

2 个答案:

答案 0 :(得分:0)

一切都在这里

https://github.com/X1011/git-directory-deploy

分享,你会发现

答案 1 :(得分:0)

查看connectCommits媒体资源:https://github.com/robwierzbowski/grunt-build-control#connectcommits

我添加了这个,以防止构建和推送无法追溯到父项目提交的代码。如果你在项目开始时做了大量的黑客操作,你可以将其设置为假,但是一旦你开始运行,我认为留下它是一个好主意。