LinuxCommandLibrary

git-feature

Manage Git feature branches

TLDR

Create and switch to a new feature branch

$ git feature [feature_branch]
copy

Merge a feature branch into the current branch creating a merge commit
$ git feature finish [feature_branch]
copy

Merge a feature branch into the current branch squashing the changes into one commit
$ git feature finish --squash [feature_branch]
copy

Send changes from a specific feature branch to its remote counterpart
$ git feature [feature_branch] [[-r|--remote]] [remote_name]
copy

SYNOPSIS

git feature [start|create] <name> [--push] | [finish|delete] <name>

PARAMETERS

start <name>
    Create and switch to a new feature branch named <name>

finish <name>
    Merge feature branch into develop and delete it

--push
    Push the feature branch to remote after creation

--track
    Set up tracking with remote branch (in some impls)

DESCRIPTION

The git-feature command is not a core part of Git or standard Linux distributions. It typically refers to custom scripts, aliases, or third-party extensions for managing feature branches in Git workflows. In common usage, developers create feature branches manually with git checkout -b feature/name or use tools like AVH Edition of git-flow, which provides git flow feature start/track/finish subcommands.

Custom git feature implementations often automate creating, publishing, and deleting feature branches, integrating with remote repositories like GitHub or GitLab. For example, a script might run git checkout -b feature/$(date +%Y%m%d-%H%M)-$1; git push -u origin feature/$(date +%Y%m%d-%H%M)-$1. Without specific installation, invoking git feature will result in a 'not found' error. Check your PATH, Git aliases (git config --get-regexp alias.feature), or installed extensions like git-extras or git-flow.

CAVEATS

Not a standard Git command; requires custom setup or git-flow installation. Behavior varies by implementation. Always verify with git feature --help if available.

EXAMPLE USAGE

git feature start my-feature
Creates feature/my-feature branch.
git feature finish my-feature
Merges and cleans up.

INSTALLATION

Install git-flow: apt install git-flow (Debian) or brew. Or add alias: git config --global alias.feature '!f() { git checkout -b feature/$1; }; f'.

HISTORY

Emerged in Git workflows post-2005 with git-flow (2010 by Vincent Driessen). Custom git feature scripts popularized in team setups for streamlined branching model, avoiding direct core Git integration.

SEE ALSO

Copied to clipboard