source: Dev/trunk/node_modules/grunt-git-deploy/README.md @ 516

Last change on this file since 516 was 516, checked in by hendrikvanantwerpen, 11 years ago

Enable deployment with Grunt.

File size: 1.7 KB
Line 
1# grunt-git-deploy
2
3> Deploy files to any branch of any remote git repository.
4
5## Getting Started
6This plugin requires Grunt `~0.4.1`
7
8If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
9
10```shell
11npm install grunt-git-deploy --save-dev
12```
13
14Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
15
16```js
17grunt.loadNpmTasks('grunt-git-deploy');
18```
19
20## The "git_deploy" task
21
22### Overview
23The way this task works is it creates an empty git repository in the `src` directory you specify, creates an orphan branch and commits all files from that directory to it. Then it pushes the branch to the configured remote repository. **Be careful as this destroys the history of the remote branch.**
24
25In your project's Gruntfile, add a section named `git_deploy` to the data object passed into `grunt.initConfig()`.
26
27```js
28grunt.initConfig({
29  git_deploy: {
30    your_target: {
31      options: {
32        url: 'git@github.com:example/repo.git'
33      },
34      src: 'directory/to/deploy'
35    },
36  },
37})
38```
39
40### Options
41
42#### options.url
43Type: `String`
44
45The URL to a remote git repository. This option is required.
46
47#### options.branch
48Type: `String`
49Default value: `'gh-pages'`
50
51The branch to push to.
52
53#### options.message
54Type: `String`
55Default value: `'autocommit'`
56
57Commit message.
58
59## Contributing
60If you can think of a way to unit test this plugin please take a shot at it.
Note: See TracBrowser for help on using the repository browser.