<commit_before>= git-reflow (2015 Fukuoka Ruby Award Winner)

{<img src="https://circleci.com/gh/reenhanced/gitreflow.svg?style=svg" alt="Circle CI" />}[https://circleci.com/gh/reenhanced/gitreflow]
{<img src="https://img.shields.io/badge/git--reflow-v0.8.0-blue.svg?style=flat&link=https://github.com/reenhanced/gitreflow" alt="Git workflow powered by git-reflow" />}[https://github.com/reenhanced/gitreflow]
{<img src="http://inch-ci.org/github/reenhanced/gitreflow.svg?branch=master&style=shields" alt="Documentation" />}[http://inch-ci.org/github/reenhanced/gitreflow]

{RDocs}[http://www.rubydoc.info/gems/git_reflow]

http://reenhanced.com/reflow/git-reflow-deliver.gif

If your workflow looks like this:
1. Create a feature branch
2. Write great code
3. Create a pull request against master
4. Get 'lgtm' through a code review
5. Squash merge to master (Why is squash merging our preferred workflow? https://github.com/reenhanced/gitreflow/issues/52)
6. Delete the feature branch

Reflow will make your life easier.

Reflow automatically creates pull requests, ensures the code review is approved, and squash merges finished branches to master with a great commit message template.

== Quickstart
Create and switch to new branch +nh-branchy-branch+:
  $ git reflow start nh-branchy-branch

Create a pull request for your branch against +master+ or a custom +base_branch+:
  $ git reflow review

If your code is 'LGTM'd, squash merge to +base_branch+ and delete the feature branch:
  $ git reflow deliver

----

== Benefits:
* Enforce code reviews across your team.
* Know that your entire team delivers code the same way.
* Reduce the knowledge needed to deliver great code.
* Have a commit history that's clean and actually usable.
* Revert features with ease (if needed).
* Work with diverse teams with less worry about different processes.
* Stop searching for other git workflows.
  Reflow covers 90% of your needs without junk you'll never use.

== Features:
* Automatically create pull requests to master
* Automatically ensure that your code is reviewed before merging
* Start with sensible commit messages by default
* Squash merge feature branches because results are more important than details
* Automatically clean up obsolete feature branches after a successful merge

----

== How to use

=== Dependencies

*Editor* When reviewing the title and body for a new pull request, or reviewing the
commit message when delivering a feature, we will open a temporary file with
your default editor.  We will use git's chosen editor first ("core.editor" git config key), then we try your
"EDITOR" environment variable, and lastly we fallback on "vim".
If you would like to use an editor of your choice, we recommend setting it with
git's config.  As an example, to use Atom as your editor for all git commands:
  $ git config --global core.editor "atom --wait"
See GitHub's full article on [associating text editors with Git](https://help.github.com/articles/associating-text-editors-with-git/) for more information on adding this.


=== Installation
  $ gem install reflow
or
  $ gem install git_reflow

(`git_reflow` is the official gem, and `reflow` just declares `git_reflow` as a dependency.)

=== Setup
On your first install, you'll need to setup your Github credentials. These are used only to get an oauth token that's stored in your global git config.
We use the Github credentials so we can create pull requests from the command line.

After installation, run:
  git reflow setup

It looks like this:
  $ git reflow setup
  Please enter your GitHub username: nhance
  Please enter your GitHub password (we do NOT store this):

  Your GitHub account was successfully setup!

This is safe to run multiple times. We don't care.

=== Usage with Github Enterprise
To use GitReflow with a GitHub Enterprise account, there are some additional switches available to the GitReflow setup command. You should be able to use GitReflow for both your Enterprise and non-Enterprise repositories. Because of this, there are a few scenarios that may apply to your usage of GitReflow:

You use a GitHub Enterprise account for the majority of your repositories:
  git reflow setup --enterprise
After this, anytime you want to use GitReflow with project that uses a regular GitHub account:
  cd replace_with_your_non_enterprise_project_path
  git reflow setup --local
This will setup your project's git config with the OAuth token generated from the credentials you provide

If you only use GitHub Enterprise for a select few repositories, you'll first want to setup GitReflow as normal:
  git reflow setup
Then for your Enterprise projects, you have to setup GitReflow for each one:<commit_msg>Updates readme with details on customization (#214)<commit_after>= git-reflow (2015 Fukuoka Ruby Award Winner)

{<img src="https://circleci.com/gh/reenhanced/gitreflow.svg?style=svg" alt="Circle CI" />}[https://circleci.com/gh/reenhanced/gitreflow]
{<img src="https://img.shields.io/badge/git--reflow-v0.8.0-blue.svg?style=flat&link=https://github.com/reenhanced/gitreflow" alt="Git workflow powered by git-reflow" />}[https://github.com/reenhanced/gitreflow]
{<img src="http://inch-ci.org/github/reenhanced/gitreflow.svg?branch=master&style=shields" alt="Documentation" />}[http://inch-ci.org/github/reenhanced/gitreflow]

{RDocs}[http://www.rubydoc.info/gems/git_reflow]

http://reenhanced.com/reflow/git-reflow-deliver.gif

If your workflow looks like this:
1. Create a feature branch
2. Write great code
3. Create a pull request against master
4. Get 'lgtm' through a code review
5. Merge to master (squashed by default, but can be overridden; why is squash merging our preferred workflow? https://github.com/reenhanced/gitreflow/issues/52)
6. Delete the feature branch

Reflow will make your life easier.

Reflow automatically creates pull requests, ensures the code review is approved, and merges finished branches to master with a great commit message template.

== Quickstart
Create and switch to new branch +nh-branchy-branch+:
  $ git reflow start nh-branchy-branch

Create a pull request for your branch against +master+ or a custom +base_branch+:
  $ git reflow review

If your code is 'LGTM'd, merge to +base_branch+ and delete the feature branch:
  $ git reflow deliver

----

== Benefits:
* Enforce code reviews across your team.
* Know that your entire team delivers code the same way.
* Reduce the knowledge needed to deliver great code.
* Have a commit history that's clean and actually usable.
* Revert features with ease (if needed).
* Work with diverse teams with less worry about different processes.
* Stop searching for other git workflows.
  Reflow covers 90% of your needs without junk you'll never use.

== Features:
* Automatically create pull requests to master
* Automatically ensure that your code is reviewed before merging
* Start with sensible commit messages by default
* Squash merge feature branches because results are more important than details
* Automatically clean up obsolete feature branches after a successful merge

----

== How to use

=== Dependencies

*Editor* When reviewing the title and body for a new pull request, or reviewing the
commit message when delivering a feature, we will open a temporary file with
your default editor.  We will use git's chosen editor first ("core.editor" git config key), then we try your
"EDITOR" environment variable, and lastly we fallback on "vim".
If you would like to use an editor of your choice, we recommend setting it with
git's config.  As an example, to use Atom as your editor for all git commands:
  $ git config --global core.editor "atom --wait"
See GitHub's full article on [associating text editors with Git](https://help.github.com/articles/associating-text-editors-with-git/) for more information on adding this.


=== Installation
  $ gem install reflow
or
  $ gem install git_reflow

(`git_reflow` is the official gem, and `reflow` just declares `git_reflow` as a dependency.)

=== Setup
On your first install, you'll need to setup your Github credentials. These are used only to get an oauth token that's stored in your global git config.
We use the Github credentials so we can create pull requests from the command line.

After installation, run:
  git reflow setup

It looks like this:
  $ git reflow setup
  Please enter your GitHub username: nhance
  Please enter your GitHub password (we do NOT store this):

  Your GitHub account was successfully setup!

This is safe to run multiple times. We don't care.

=== Customization
There are several git config variables that can be set (either globally or per-project) to override some parts of our workflow.

To set them globally for all your projects, run the following from the command line:

  $ git config -f $HOME/.gitconfig.reflow --replace-all "CONFIG_KEY_TO_OVERRIDE_AS_LISTED_BELOW" "REPLACE_WITH_NEW_VALUE"

You can also override your default globals on a per-project basis using:

  $ git config --replace-all "CONFIG_KEY_TO_OVERRIDE_AS_LISTED_BELOW" "REPLACE_WITH_NEW_VALUE"

* `core.editor` – Use an editor of your choice when modifying PR details and commit messages. Our default is `vim`.
* `reflow.merge-method` – Use a merge method of your choice.  For Github, options are `merge` (uses standard `git merge`), `squash`, `rebase`.  All other git-servers currently only support `merge` and `squash`.  Our default is `squash`.
* `constants.minimumApprovals` – number of approvals needed in order to deliver a feature. Our default is `0`, which means all commenters need to approve.
* `constants.approvalRegex` – a regular expression to mark comments as approved.  Our default is `/(?i-mx:lgtm|looks good to me|:\+1:|:thumbsup:|:shipit:)/`
* `reflow.always-cleanup` – If set to `true`, this will skip the prompt `Would you like to push this branch to your remote repo and cleanup your feature branch?`. Default is unset.
* `reflow.always-deliver` – If set to `true`, this will skip the prompt `This is the current status of your Pull Request. Are you sure you want to deliver?`
* `reflow.deploy-to-staging-command` – A command that can be run to deploy the current branch to a staging server.  Default is unset.

=== Usage with Github Enterprise
To use GitReflow with a GitHub Enterprise account, there are some additional switches available to the GitReflow setup command. You should be able to use GitReflow for both your Enterprise and non-Enterprise repositories. Because of this, there are a few scenarios that may apply to your usage of GitReflow:

You use a GitHub Enterprise account for the majority of your repositories:
  git reflow setup --enterprise
After this, anytime you want to use GitReflow with project that uses a regular GitHub account:
  cd replace_with_your_non_enterprise_project_path
  git reflow setup --local
This will setup your project's git config with the OAuth token generated from the credentials you provide

If you only use GitHub Enterprise for a select few repositories, you'll first want to setup GitReflow as normal:
  git reflow setup
Then for your Enterprise projects, you have to setup GitReflow for each one:
{'fraction_non_alphanumeric': 0.07341430499325236, 'fraction_numerical': 0.0035087719298245615, 'mean_word_length': 4.522106308991555, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2516617', 'n_tokens_mistral': 3141, 'n_tokens_neox': 2996, 'n_words': 1485}