1.1.1 • Published 1 year ago

git-pr-helper v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

git-pr-helper

This tool helps manage git branches when using three long-lived develop, staging and release branches.

The GitHub CLI needs to be installed on your computer first, as this is how the PRs are created.

Usage

npx git-pr-helper <command>

I recommend setting up a git alias to avoid having to type npx git-pr-helper every time. Add the following to your .gitconfig file:

[alias]
        pr-helper = !npx git-pr-helper $@

Commands

init

This is required before running any other command. It will ask some basic questions related to your branching setup.

Throughout this guide, I will refer to the three branches as develop, staging and release, even though it may differ slightly in your project.

create <name>

This will create a new branch based on the name. This must start with either feature/, bugfix/ or hotfix/. Features and bugfixes will come off develop, whereas hotfixes will come off release.

finish [name] [--staging]

This will do different things depending on whether the branch is a feature, bugfix or hotfix branch. By default this will work with the current branch; you can alternatively provide a branch name.

If it is a feature or hotfix:

  • This will create a PR from the feature branch to develop. It will then move you back to develop.
  • If the --staging flag is provided, it will create a PR for staging as well as develop.

If it is a hotfix:

  • It will create a PR from the hotfix branch to release.
  • It will then create a PR from the hotfix branch into develop and staging.
  • Finally, it will move you back to release.

promote develop

This will create two PRs:

  • First, release to develop, which should be merged first.
  • Then develop to staging.

promote staging

This will create a PR from staging to release.

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago