Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for new gem extracted from https://github.com/chrisk/git-extras
- Loading branch information
Showing
2 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# git trimbranches | ||
|
||
A handy little git porcelain to automate the removal of old topic branches | ||
you've already merged to master. | ||
|
||
## Installation | ||
|
||
$ gem install git-trimbranches | ||
|
||
## How it works | ||
|
||
**Preflight:** First, it does a `git fetch` and `git remote prune origin` in the | ||
current working directory to make sure your list of remote branches is | ||
up-to-date. | ||
|
||
**Finding branches that can be safely removed:** Then, it uses the `--merged` | ||
option to `git branch` to find out which branches are already merged to | ||
`origin/master`. It ignores branches with names including the words "master", | ||
"staging", "production", or "stable". | ||
|
||
**Deleting the branches:** Finally, it uses `git push origin :branchname` to | ||
delete each of those branches from the remote. If a local copy of the branch | ||
exists, it is also removed. The script prints the name of each deleted branch | ||
with its SHA so you can recreate the branch if needed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters