@debiao/ogit

1.2.5 • Public • Published

ogit

oscar git commander

一款命令行工具,用来在终端下进行移植commit,提交merge request等工作。

目前支持的命令有:

  • ogit cp [options]

    移植一个commit到指定分支,推送到fork仓库,并向公共仓库发起merge request

  • ogit mr [options]

    将分支推送到fork仓库,并向公共仓库发起merge request

  • ogit config [options]

    配置一些选项,比如公共仓库、fork仓库、gitlab账户等

  • ogit clean [options]

    删除ogit建立的分支

详细用法使用 ogit -h 查看:

Usage: ogit <command> [options]

命令:
  ogit cp      cherry-pick
  ogit mr      submit a merge request
  ogit config  config project
  ogit clean   clean temp branch

选项:
  --version   显示版本号                                                  [布尔]
  -h, --help  显示帮助信息                                                [布尔]

示例:
  ogit cp -c 6ce56e1d -t oscar -a           在分支oscar上创建新分支,将提交6ce56e1d移入该分支,然后将该
  zhouyongliang                             分支推送至fork仓库并发起mr,目标分支为公共仓库oscar,评审人为
                                            zhouyongliang
  ogit config -o public -f my               配置该项目公共仓库为public,fork仓库为my
  ogit config -k pwd -r                     配置公钥,私钥以及私钥密码,ssh协议使用
  C:\Users\yukai\.ssh\id_rsa -u
  C:\Users\yukai\.ssh\id_rsa.pub
  ogit config -g yukai -p pwd               配置gitlab账户为yukai,密码为pwd,http协议使用
  ogit mr -b test -t oscar -a               将分支test推送到fork仓库并作为mr源分支,目标分支为公共仓库os
  zhouyongliang                             car,评审人为zhouyongliang
  ogit clean                                清除ogit建立的分支

copyright 2019

安装

  1. 安装Node

  2. Node 安装完成后,在终端中执行 npm install -g @debiao/ogit,进行安装

  3. 使用命令 ogit update -g @debiao/ogit 进行更新

依赖

  • axios

  • jsonfile

  • nodegit

  • shelljs

  • yargs

  • pkg-updater

注意

  1. 在推送到远程之前会对commit的格式进行检查,如果不符合要求(/^((WIP:\s*)?(revert: |rework: )?(req|bug|perf|chore))( #\d+)+( )?:( ).+/),会尝试打开编辑器修改。

    使用 git config --global core.editor 指定你的默认编辑器:

    • notepad++:git config --global core.editor "'D:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

    • vscode:git config --global core.editor "'D:\tools\Microsoft VS Code Insiders\Code - Insiders.exe' --wait"

  2. 注意一定要使用 UTF-8 编码填写commit信息,否则会有编码问题

Readme

Keywords

none

Package Sidebar

Install

npm i @debiao/ogit

Weekly Downloads

2

Version

1.2.5

License

MIT

Unpacked Size

352 kB

Total Files

20

Last publish

Collaborators

  • debiao