I have a git repo which contains many submodules. When I commit in a submodule, I have a git hook which is supposed to commit in the "supermodule". Unfortunately, the commit in the post-commit hook fails because the "supermodule" can't seem to detect the changes in its submodule.
Is there any other way I can achieve this behavior?
I have all this set up through Grunt using grunt-githooks
and grunt-git
.
Below is my gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
githooks: {
all: {
options: {
dest: '../../../.git/modules/server/modules/mymodule/hooks'
},
'post-commit': 'updateSuperModule'
}
},
gitcommit: {
all: {
options: {
message: 'Updated Submodule',
cwd: '../../..',
verbose: true
},
files: {
src: ['.']
}
}
},
gitpush: {
all: {
options: {
cwd: '../../..',
verbose: true
}
}
}
});
grunt.loadNpmTasks('grunt-githooks');
grunt.loadNpmTasks('grunt-git');
};