File tree Expand file tree Collapse file tree 2 files changed +65
-1
lines changed
Expand file tree Collapse file tree 2 files changed +65
-1
lines changed Original file line number Diff line number Diff line change 22 * @Author: LetMeFly
33 * @Date: 2022-05-19 18:48:53
44 * @LastEditors: LetMeFly
5- * @LastEditTime: 2023-10-19 21:33:01
5+ * @LastEditTime: 2023-10-19 22:00:51
66-->
77# LeetCode
88
@@ -603,6 +603,7 @@ int main() {
603603| FFmpeg(强大的音视频处理工具) - 一些基本实用方法| <a href =" https://blog.tisfy.eu.org/2023/07/03/Other-FFmpeg-SomeCommonUsage/ " >本平台博客</a >| 无|
604604| 模糊测试 - 论文翻译 - Montage: A Neural Network Language Model-Guided JavaScript Engine Fuzzer| <a href =" https://leetcode.letmefly.xyz/2023/04/06/Other-Fuzz-Montage-JSEngineFuzzer-Translation/ " >本平台博客</a >| 无|
605605| 原神 - 维系天理 - 一个大佬用C++OpenCV写的原神地图辅助工具| <a href =" https://blog.tisfy.eu.org/2023/02/05/Other-Genshin-WeiXiTianLi-HelperByC++OpenCV/ " >本平台博客</a >| 无|
606+ | 使用GH(命令行)在本地提出Github上的issue、PR,合并PR| <a href =" https://blog.tisfy.eu.org/2023/10/19/Other-Github-CreatingIssuePrMergingPrByCMD-GH/ " >本平台博客</a >| <a href =" https://letmefly.blog.csdn.net/article/details/133935823 " >CSDN博客</a >|
606607| HTML - 使用Python快速生成HTML的UI| <a href =" https://blog.tisfy.eu.org/2023/04/04/Other-HTML-AutoGenerateHTMLByPython/ " >本平台博客</a >| 无|
607608| HTML - 网站永久重定向301修改了之后,Google浏览器如何重新定位到新地址| <a href =" https://blog.tisfy.eu.org/2023/04/05/Other-HTML-ChangePermanentRedirect301ByGoogle/ " >本平台博客</a >| 无|
608609| 如何将网站某页面全部修改为黑白色| <a href =" https://blog.tisfy.eu.org/2022/12/01/Other-HTML-ChangeWeb2Gray/ " >本平台博客</a >| 无|
Original file line number Diff line number Diff line change 1+ ---
2+ title : 使用GH(命令行)在本地提出Github上的issue、PR,合并PR
3+ date : 2023-10-19 21:55:44
4+ tags : [其他, Github]
5+ ---
6+
7+ # 使用GH(命令行)在本地提出Github上的issue、PR,合并PR
8+
9+ ## 前言
10+
11+ Github上的一些操作使用Git命令是无法完成的,因此正常流程就是在网页端进行。等一下,你让程序员用网页进行?果然,有命令行工具可以完成以上任务:[ GH] ( https://cli.github.com ) 。并且,该工具还支持以ssh的方式操作,这样就基本上杜绝了``` https://github.com ``` 间歇性无法访问的尴尬。
12+
13+ ## 首次下载、配置登录
14+
15+ 进入[ 官网] ( https://cli.github.com ) 点击[ Download for Windows] ( https://github.com/cli/cli/releases/download/v2.32.1/gh_2.32.1_windows_amd64.msi ) ,安装后会得到``` gh.exe ``` (在虚拟机中安装后将``` gh.exe ``` 拷贝到环境变量中效果是一样的)。
16+
17+ 首次需要使用命令``` gh auth login ``` 进行登录。这是应该是不可避免地要访问一下网页,但之后应该就不用了。之后依次选择(上下选择后回车选中)或输入(输入后回车):
18+
19+ 1 . Github.com
20+ 2 . ** SSH**
21+ 3 . C:\xx\. ssh\id_rsa.pub
22+ 4 . GH SSH Key
23+ 5 . Login with a web browser
24+ 6 . 复制 ``` one-time code ```
25+ 7 . 在网页端根据提示完成后续操作
26+
27+ 最终所有配置会缓存在``` %userprofile%\AppData\Roaming\GitHub CLI ``` 下。
28+
29+ ## 创建issue
30+
31+ 在本地** git仓库** 目录中使用以下命令即可在Github上创建issue:
32+
33+ ``` bash
34+ gh issue create -t " 标题title" -b " body"
35+ ```
36+
37+ ## 创建PR
38+
39+ 在本地git仓库目录的想发起PR的分支中,使用以下命令即可在Github上创建PR:
40+
41+ ``` bash
42+ gh pr create -t " 标题title" -b " body"
43+ gh pr create -t " GH 使用小笔记" -b " close: #37"
44+ ```
45+
46+ ## 合并PR并删除 本地和远程 的分支
47+
48+ ``` bash
49+ gh pr merge GHNote -m -d
50+ ```
51+
52+ 其中``` 38 ``` 是pr的编号,还可以换成``` url ``` 或``` branch ``` 。
53+
54+ 其中``` -m ``` 是以``` merge ``` 的方式合并。还可以换成``` -r ``` (``` rebase ``` )或``` -s ``` (``` squash ``` )。
55+
56+ 其中``` -d ``` 代表合并后删除本地和远端的分支。
57+
58+ ## More
59+
60+ 在几乎任何使用,使用``` gh xx --help ``` 以获得帮助。
61+
62+ > 原创不易,转载请附上[ 原文链接] ( https://blog.tisfy.eu.org/2023/10/19/Other-Github-CreatingIssuePrMergingPrByCMD-GH/ ) 哦~
63+ > Tisfy:[ https://letmefly.blog.csdn.net/article/details/133935823 ] ( https://letmefly.blog.csdn.net/article/details/133935823 )
You can’t perform that action at this time.
0 commit comments