git-pretty-accept
git-pretty-accept
is a script that rebases a pull request before merging
to master. Pull requests are always merged recursively. The result is a
linear history with merge bubbles indicating pull requests. In short, pretty.
For more information, check out
git-pretty-accept
also automatically deletes the local and remote branch
of the pull request once it's merged to master.
Installation
Add this line to your application's Gemfile:
gem 'git_pretty_accept'
And then execute:
$ bundle
Or install it yourself as:
$ gem install git_pretty_accept
Usage
To accept a pull request, just run git pretty-accept BRANCH_NAME
in
the branch where BRANCH_NAME
will be merged.
Merge commit template
You can also provide a merge commit template
.git-pretty-accept-template.txt
to your project directory. This is
great if you want your merge commits to follow a certain format e.g.
you want your team to enter the issue link when accepting pull requests.
Caveats
We wrote git_pretty_accept for our particular workflow. If you'd like to use the gem, here are a few things you'll need to keep in mind. The script
- Assumes that your remote repository is origin. It doesn't work yet with Github forks.
- Automatically removes the local and remote branch of the pull request once the pull request is merged.
- Complains if you accidentally try to accept the master branch to a feature branch.
- Rebases the local branch in interactive mode so that it can run
autosquash(See
--autosquash
under http://git-scm.com/docs/git-rebase#_options).
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