<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DevOps on MeerStory</title><link>https://linux.meerstory.com/zh/categories/devops/</link><description>Recent content in DevOps on MeerStory</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 13 Nov 2026 01:10:49 +0900</lastBuildDate><atom:link href="https://linux.meerstory.com/zh/categories/devops/index.xml" rel="self" type="application/rss+xml"/><item><title>GitHub CLI 实用指南：Ubuntu环境搭建与高效终端开发工作流</title><link>https://linux.meerstory.com/zh/ubuntu/20261113_011001_295/</link><pubDate>Fri, 13 Nov 2026 01:10:49 +0900</pubDate><guid>https://linux.meerstory.com/zh/ubuntu/20261113_011001_295/</guid><description>&lt;h2 id="概述">概述&lt;/h2>
&lt;p>借助 GitHub 官方命令行工具 GitHub CLI（&lt;code>gh&lt;/code>），开发者无需频繁切出终端访问网页端，即可直接在控制台中一站式搞定代码仓协同、Issue 跟踪以及 PR 评审。本文将深入演示从基础环境部署、身份凭证检测到实际开发工作流中的高频核心指令，助力团队构建更流畅的终端原生交付体验。&lt;/p>
&lt;h2 id="ubuntu-环境下部署-github-cligh-与环境验证">Ubuntu 环境下部署 GitHub CLI(gh) 与环境验证&lt;/h2>
&lt;p>在配置外部源之前，首先确保宿主机具备拉取公钥所需的网络请求工具 &lt;code>curl&lt;/code>；若未预装，则自动通过包管理器静默安装补齐。&lt;/p>
&lt;p>&lt;img src="https://linux.meerstory.com/ubuntu/20261113_011001_295/captures/s01_c01_type_-p_curl___dev_null_____apt-get_update_-qq.png"
 alt="检测并按需安装 curl 依赖"
 
 loading="lazy"
 decoding="async"
 style="max-width: 100%; height: auto;">


&lt;/p>
&lt;p>为了防范软件包被篡改并验证官方发行版的签名完整性，抓取 GitHub 官方 GPG 密钥并安全保存至系统的受信任密钥环目录。&lt;/p>
&lt;p>&lt;img src="https://linux.meerstory.com/ubuntu/20261113_011001_295/captures/s01_c02_curl_-fsSL_https___cli_github_com_packages_githubc.png"
 alt="下载并写入 GitHub CLI 官方 GPG 密钥环"
 
 loading="lazy"
 decoding="async"
 style="max-width: 100%; height: auto;">


&lt;/p>
&lt;p>调整该 GPG 密钥文件的权限标志位，确保 APT 守护进程和系统内的非特权账户均能正常读取凭证。&lt;/p>
&lt;p>&lt;img src="https://linux.meerstory.com/ubuntu/20261113_011001_295/captures/s01_c03_chmod_go_r__usr_share_keyrings_githubcli-archive-k.png"
 alt="赋予密钥环全局读取权限"
 
 loading="lazy"
 decoding="async"
 style="max-width: 100%; height: auto;">


&lt;/p>
&lt;p>依据系统底层 CPU 架构自动生成源定义，并将 GitHub CLI 的官方 APT 软件源条目写入专用源列表配置中。&lt;/p>
&lt;p>&lt;img src="https://linux.meerstory.com/ubuntu/20261113_011001_295/captures/s01_c04_echo__deb__arch___dpkg_--print-architecture__signe.png"
 alt="添加 GitHub CLI 官方 APT 源记录"
 
 loading="lazy"
 decoding="async"
 style="max-width: 100%; height: auto;">


&lt;/p>
&lt;p>刷新本地 APT 索引缓存以识别新收录的仓库条目，随后直接调取包管理器完成 &lt;code>gh&lt;/code> 主程序的安装。&lt;/p>
&lt;p>&lt;img src="https://linux.meerstory.com/ubuntu/20261113_011001_295/captures/s01_c05_apt-get_update_-qq____apt-get_install_-y_gh.png"
 alt="刷新软件源索引并安装 gh 工具包"
 
 loading="lazy"
 decoding="async"
 style="max-width: 100%; height: auto;">


&lt;/p></description></item></channel></rss>