-test-bitbucket-branch-manager

中文文档
1.0.1发布于 2021/07/17MITCommonJS

bitbucket branch manager

原始使用文档
文档目录7 节
  1. Setup your config
  2. 1. Repositories list
  3. 2. Create branch
  4. 3. Delete branch
  5. 4. Reset branch
  6. 5. Open pull request
  7. 6. Merge pull request

Bitbucket-branch-manager is a CLI written in Nodejs. It help you manager remote branch and pull request by simple command line. This CLI follow Bitbucket API

Feature

  • Create branch
  • Delete branch
  • Reset branch
  • Open pull request
  • Merge pull request

Install

You need install nodejs. Make sure nodejs was installed ( node>= 12)

$ node -v
$ npm -v

Install bitbucket-branch-manager

$ npm install -g bitbucket-branch-manager

Check bitbucket-branch-manager was installed

$ bbm -v

Setup your config

  • Make sure your basic authentication bitbucket is set up

    $ bbm set --basic-auth-username <username> 
    $ bbm set --basic-auth-password <password> 
    
  • Set default workspace

    $ bbm set --default-workspace <workspace>
    
  • What is a workspace ? A workspace is where you will create repositories, collaborate on your code, and organize different streams of work in your Bitbucket Cloud account. At this time, you'll be provided with one workspace and one workspace ID.

  • Check config

    $ bbm get
    

Comamnd line Document

1. Repositories list

  • You can get your repositories list (limit 100 items):
    $ bbm repo
    
  • Or use alias by the way
    # set index
    $ bbm repo --set-index-alias
    # check it
    $ bbm alias
    

2. Create branch

  • This command will create new branch from another source branch, please make sure source branch or default source branch is exist
  • Command: bbm new|n <repo|aliasId> <branch> [source]
  • Option
    • -w <workspace> or --workspace <workspace>
  • Set aliasId follow 1. Repositories list or if you've already done it:
    $ bbm alias 
    #or
    $ bbm a
    
  • Set default source branch:
    # another branch you want, my example is master
    $ bbm set --default-branch-create-from master
    
  • Examples:
    • Full command:
      $ bbm new test-repo test-branch master
      
    • Short command:
      # if not set default source branch
      $ bbm n 2 test-branch master
      # default source branch has aldready
      $ bbm n 2 test-branch
      

3. Delete branch

  • Command: bbm delete|d <repo|aliasId> <branch>
  • Option
    • -w <workspace> or --workspace <workspace>
  • Examples:
    • Full command:
      $ bbm delete test-repo test-branch
      
    • Short command:
      $ bbm d 2 test-branch
      

4. Reset branch

  • This command will delete and recreate branch from another source branch, please make sure source or default source branch is exist
  • Command: bbm reset|r <repo|aliasId> [branch] [source]
  • Option
    • -w <workspace> or --workspace <workspace>
  • Set default source branch. Your branch you want reset will recreate from this:
    # another branch you want, my example is master
    $ bbm set --default-branch-reset-from master
    
  • Set default branch will reset.
    # another branch you want, my example is master
    $ bbm set --default-branch-reset staging 
    
  • Examples:
    • Full command:
      $ bbm reset test-repo test-branch master
      
    • Short command:
      # if you not set default branch
      $ bbm r 2 test-branch master
      # if default destination branch has aldready
      $ bbm r 2 test-branch
      # if default destination branch and default branch reset has aldready
      $ bbm r 2 # mean delete staging and recreate from master
      

5. Open pull request

  • This command will create pull request your into another branch.
  • Command: bbm open|o <repo|aliasId> <branch> [destination]
  • Option
    • -w <workspace> or --workspace <workspace>
    • -t <title> or --title <title> if you want set title or not title default is branch name
    • -m or --merge if you want auto merge
  • Set default destination
    # another branch you want, my example is master
    $ bbm set --default-branch-open-pull master
    
  • Examples:
    • Full command
      $ bbm open test-repo test-branch master
      
    • Short command
      # if you not set default branch
      $ bbm o 2 test-branch master
      # if default destination branch has aldready
      $ bbm o 2 test-branch
      

6. Merge pull request

  • This command will merge your pull request by id
  • Command: bbm merge|m <repo> <pullId>
  • Examples:
    • Full command:
      $ bbm merge test-repo 25
      
    • Short command:
      $ bbm m test repo 25
      

End

Thanks for spending your time to visit.

版本与发布记录

-test-bitbucket-branch-manager 共发布 1 个版本,首次发布于 2021/07/17;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.1latest2021/07/175 年前

关于 -test-bitbucket-branch-manager 的常见问题

-test-bitbucket-branch-manager 是什么?

Bitbucket分支管理器

如何安装 -test-bitbucket-branch-manager?

在项目目录运行 npm install -- -test-bitbucket-branch-manager,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 bbm,可以用 npx bbm 直接运行。

-test-bitbucket-branch-manager 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/-test-bitbucket-branch-manager 是否存在。

-test-bitbucket-branch-manager 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

-test-bitbucket-branch-manager 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=12。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

-test-bitbucket-branch-manager 可以商用吗?

-test-bitbucket-branch-manager 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

-test-bitbucket-branch-manager 还在维护吗?

最新版本 1.0.1 发布于 2021/07/17(5 年前);至今共发布 1 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/07/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。