started docs and updated end
This commit is contained in:
50
README.md
50
README.md
@@ -0,0 +1,50 @@
|
|||||||
|
### Installation
|
||||||
|
|
||||||
|
clone the repository
|
||||||
|
|
||||||
|
```
|
||||||
|
mkdir -p ~/GitHub/rkiel
|
||||||
|
git clone git@github.com:rkiel/git-feature.git
|
||||||
|
```
|
||||||
|
|
||||||
|
add the bin to your path
|
||||||
|
|
||||||
|
```
|
||||||
|
export PATH=~/GitHub/rkiel/git-feature/bin:$PATH
|
||||||
|
```
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
This utility is built around some standard branch names: `master`, `develop`, and `integration`.
|
||||||
|
|
||||||
|
Feature branches have specific format: USER-BASE-FEATURE.
|
||||||
|
|
||||||
|
* USER is the username as specificied by the USER environment variable
|
||||||
|
* BASE is the branch to base the feature branch on
|
||||||
|
* FEATURE is the name of the feature
|
||||||
|
|
||||||
|
#### Start
|
||||||
|
|
||||||
|
To start a new feature, go to one of the standard branches.
|
||||||
|
|
||||||
|
```
|
||||||
|
git checkout master
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the `start` subcommand with a feature name.
|
||||||
|
|
||||||
|
```
|
||||||
|
feature start my-new-feature
|
||||||
|
```
|
||||||
|
|
||||||
|
For example, a new branch will be created called `rkiel-master-my-new-feature`
|
||||||
|
|
||||||
|
#### End
|
||||||
|
|
||||||
|
Use the `end` subcommand to close out the feature.
|
||||||
|
|
||||||
|
```
|
||||||
|
feature end
|
||||||
|
```
|
||||||
|
|
||||||
|
For example, the feature branch `rkiel-master-my-new-feature` will be deleted the `master` will be checked out.
|
||||||
|
|||||||
@@ -120,11 +120,14 @@ class End < Base
|
|||||||
def execute
|
def execute
|
||||||
error "USAGE: feature end" unless ARGV.size == 1
|
error "USAGE: feature end" unless ARGV.size == 1
|
||||||
|
|
||||||
|
parts = parse_branch(current_branch)
|
||||||
|
|
||||||
|
standard_branch = parts[:standard]
|
||||||
feature_branch = current_branch
|
feature_branch = current_branch
|
||||||
|
|
||||||
error "invalid feature branch: #{feature_branch}" if standard_branches.include? feature_branch
|
error "invalid feature branch: #{feature_branch}" if standard_branches.include? feature_branch
|
||||||
|
|
||||||
run_cmd "git checkout master"
|
run_cmd "git checkout #{standard_branch}"
|
||||||
|
|
||||||
if remote_branch(feature_branch) != ""
|
if remote_branch(feature_branch) != ""
|
||||||
run_cmd "git push origin :#{feature_branch}"
|
run_cmd "git push origin :#{feature_branch}"
|
||||||
@@ -136,6 +139,7 @@ class End < Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
error "USAGE: feature cmd branch" unless ARGV.size > 0
|
error "USAGE: feature cmd branch" unless ARGV.size > 0
|
||||||
|
|
||||||
command = case ARGV[0]
|
command = case ARGV[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user