---
title: "用 hub 从命令行创建 pr"
description: "先用 brew 安装 hub：brew install hub 然后使用像下面示例这样的简单命令：hub pull-request -m \"best pr ever\" -b oozou:develop -h feature/awesome-improvements"
canonical: https://oozou.com/til/make-a-pr-from-command-line-using-hub-3
locale: zh-Hans
date: 2020-10-13
topic: shell
---

# 用 hub 从命令行创建 pr

> 先用 brew 安装 hub：brew install hub 然后使用像下面示例这样的简单命令：hub pull-request -m "best pr ever" -b oozou:develop -h feature/awesome-improvements

Published: 2020-10-13 · Topic: [shell](https://oozou.com/zh-Hans/til-topics/shell) ([markdown](https://oozou.com/zh-Hans/til-topics/shell.md))

先用 brew 安装 **hub**：
*brew install hub*
然后使用像下面示例这样的简单命令：
*hub pull-request -m "best pr ever" -b oozou:develop -h feature/awesome-improvements*

或更聪明的做法：

```
hub pull-request -m "best pr ever" -b oozou:develop -h $(git rev-parse --abbrev-ref HEAD)
```

想了解创建 pull request 的更多细节，请参考 *hub pull-request --help*

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/zh-Hans/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
