GitSubmoduleTask
git_submodule_task provide the internal DSL to write tasks for git submodule.
Installation
$ git clone git@github.com:ainame/git_submodule_task.git
$ cd git_submodule_task
$ gem build git_submodule_task.gemspec
$ gem install git_submodule_task-0.0.1.gem
Usage
- install gem
- create
Submodulefile
on project's root directory - write the task on it.
for example
require 'git_submodule_task/dsl'
submodule 'library/ActionBarSherlock' do |sm|
# force reset to update...
sm.execute "git reset HEAD --hard"
# pull from original source
sm.execute "git pull github master"
# commit to parent repository
sm.parent.commit("[submodule] update #{sm.repo_path}\"")
# reflect to remote of submodule
sm.execute "git push origin master"
# commit to remote parent repository
sm.parent.push('origin', sm.parent.current_branch)
end
- Then, execute
submodule_update SUBMODULE_PATH
, git_submodule_task execute that task.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request