Linux command
git-feature 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Create feature branch
git feature [feature_name]
Create feature branch with remote tracking
git feature [feature_name] -r [origin]
Create feature branch from a specific start point
git feature [feature_name] --from [develop]
Finish feature branch (merge and delete)
git feature finish [feature_name]
Finish with squash merge
git feature finish --squash [feature_name]
说明
git feature provides high-level commands for working with feature branches following a standardized naming convention. As part of the git-extras suite, it simplifies the common workflow of creating, developing, and completing feature work in separate branches. When creating a feature branch, the command automatically applies a "feature/" prefix to maintain consistent naming across the repository. The finish subcommand handles merging the feature back into the main development branch and cleaning up afterward, encapsulating multiple manual git operations into a single command.
参数
- -a _PREFIX_, --alias _PREFIX_
- Use a custom branch prefix instead of "feature".
- -s _SEPARATOR_, --separator _SEPARATOR_
- Use a custom separator instead of "/".
- -r _REMOTE_, --remote _REMOTE_
- Set up a remote tracking branch (defaults to origin).
- --from _START_POINT_
- Create the feature branch from a specific commit or branch.
- --squash
- Perform a squash merge when finishing.
FAQ
What is the git-feature command used for?
git feature provides high-level commands for working with feature branches following a standardized naming convention. As part of the git-extras suite, it simplifies the common workflow of creating, developing, and completing feature work in separate branches. When creating a feature branch, the command automatically applies a "feature/" prefix to maintain consistent naming across the repository. The finish subcommand handles merging the feature back into the main development branch and cleaning up afterward, encapsulating multiple manual git operations into a single command.
How do I run a basic git-feature example?
Run `git feature [feature_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a _PREFIX_, --alias _PREFIX_ do in git-feature?
Use a custom branch prefix instead of "feature".