# @debiao/ogit

> oscar git commander

Latest version **1.2.5** (published 2020-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @debiao/ogit
pnpm add @debiao/ogit
yarn add @debiao/ogit
bun add @debiao/ogit
```

Provides the command `ogit`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2020-03-27 |
| First published | 2019-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 344.2 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | yukai |
| Maintainers | debiao |

## Links

- npm: https://www.npmjs.com/package/@debiao/ogit
- npm.io page: https://npm.io/package/@debiao/ogit

## Dependencies (8)

- [open](https://npm.io/package/open.md) ^6.3.0
- [axios](https://npm.io/package/axios.md) ^0.19.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [yargs](https://npm.io/package/yargs.md) ^13.2.2
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3
- [inquirer](https://npm.io/package/inquirer.md) ^6.3.1
- [jsonfile](https://npm.io/package/jsonfile.md) ^5.0.0
- [pkg-updater](https://npm.io/package/pkg-updater.md) ^1.0.4

## Recent versions

- 1.2.5 (latest) — 2020-03-27
- 1.2.4 — 2019-09-03
- 1.2.3 — 2019-09-03
- 1.2.2 — 2019-06-25
- 1.2.1 — 2019-06-25
- 1.1.5 — 2019-06-06
- 1.1.4 — 2019-06-06
- 1.1.3 — 2019-06-06
- 1.1.2 — 2019-06-06
- 1.1.1 — 2019-06-05
- 1.1.0 — 2019-06-05
- 1.0.5 — 2019-03-18
- 1.0.4 — 2019-03-17
- 1.0.3 — 2019-03-14
- 1.0.2 — 2019-03-14
- … 2 more at https://npm.io/package/@debiao/ogit/versions

## README

# 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](https://nodejs.org/dist/v10.15.3/node-v10.15.3-x64.msi)

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信息，否则会有编码问题

---
_Source: https://npm.io/package/@debiao/ogit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
