git-feature(1) - Create/Merge feature branch

1. git-feature(1)
2. Git Extras
3. git-feature(1)

## NAME

`git-feature` - Create/Merge feature branch

## SYNOPSIS

`git-feature` [-a|--alias branch_prefix] [-s|--separator branch_separator] [-r|--remote [remote_name]] <name>
`git-feature` [-a|--alias branch_prefix] [-s|--separator branch_separator] finish [--squash] <name>

## DESCRIPTION

Create/Merge the given feature branch.

The branch `name` may be specified as multiple words which will be joined with `-` characters. If any word should start with a `-`, the name should be preceded by `--`, which will signal that option parsing should be ignored.

## OPTIONS

<-a|--alias branch_prefix>

The branch prefix to use, or `feature` if not supplied.

<-s|--separator branch_separator>

The separator to use for joining the branch prefix and the branch name, or `/` if not supplied.

<-r|--remote [remote_name]>

Setup a remote tracking branch using `remote_name`. If `remote_name` is not supplied, use `origin` by default.

<--from [start_point]>

Setup a start point when the branch created. If `--from` is not supplied, use the current branch by default.

<finish>

Merge and delete the feature branch.

<--squash>

Run a squash merge.

<name>

The name of the feature branch.

## GIT CONFIG

You can configure the default branch prefix and separator via git config options.

$ git config --global add git-extras.feature.prefix "branch_prefix"

The default `branch_prefix` is `feature`.

$ git config --global add git-extras.feature.separator "-"

The default `branch_separator` is `/`.

## EXAMPLES

Start a new feature:

  $ git feature dependencies
  ...
  $ (feature/dependencies) git commit -m "Some changes"

Finish a feature with --no-ff merge:

  $ (feature/dependencies) git checkout master
  $ git feature finish dependencies

Finish a feature with --squash merge:

  $ (feature/dependencies) git checkout master
  $ git feature finish --squash dependencies

Publish a feature upstream:

  $ git feature dependencies -r upstream

Use custom branch prefix:

  $ git alias features "feature -a features"
  $ git features dependencies
  $ (features/dependencies) ...
  $ (features/dependencies) git checkout master
  $ git features finish dependencies

Use custom branch separator:

  $ git feature -s - dependencies
  $ (feature-dependencies) ...
  $ (feature-dependencies) git checkout master
  $ git feature -s - finish dependencies

Use custom branch prefix and separator from git config with multiple words:

  $ git config --global --add git-extras.feature.prefix "features"
  $ git config --global --add git-extras.feature.separator "."
  $ git feature dependency tracking
  $ (features.dependency-tracking) ...
  $ (features.dependency-tracking) git checkout master
  $ git feature finish dependency tracking

Use a `git-feature` option flag as part of a branch name:

  $ git feature -- --remote
  ...
  $ (feature/--remote) git commit -m "Some changes"

## AUTHOR

Written by Jesús Espino <jespinog@gmail.com>
Modified by Mark Pitman <mark.pitman@gmail.com>
Modified by Carlos Prado <carlos.prado@cpradog.com>
Modified by Austin Ziegler <halostatue@gmail.com>

## REPORTING BUGS

<https://github.com/tj/git-extras/issues>

## SEE ALSO

<https://github.com/tj/git-extras>

2. September 2023
3. git-feature(1)