<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: LewisMK</title>
    <description>The latest articles on Forem by LewisMK (@lewismk).</description>
    <link>https://forem.com/lewismk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1533693%2Fe6948baf-027f-4d59-8d13-16e7f75e13cb.jpeg</url>
      <title>Forem: LewisMK</title>
      <link>https://forem.com/lewismk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lewismk"/>
    <language>en</language>
    <item>
      <title>Getting Started with GitHub CLI: A Quick Guide to Installation and Usage</title>
      <dc:creator>LewisMK</dc:creator>
      <pubDate>Mon, 27 May 2024 17:08:25 +0000</pubDate>
      <link>https://forem.com/swahilipotdevs/getting-started-with-github-cli-a-quick-guide-to-installation-and-usage-325d</link>
      <guid>https://forem.com/swahilipotdevs/getting-started-with-github-cli-a-quick-guide-to-installation-and-usage-325d</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Installing GitHub (gh)  the command-line interface (CLI) is a straightforward process that allows you to interact with GitHub repositories, issues, pull requests, and more directly from your terminal or command prompt. Here's a brief and clear guidance to installing GitHub CLI:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Git&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before you start using Git, you have to make it available on your computer. it’s recommended to update to the latest version. You can either install it as a package or via another installer, or download the source code and compile it yourself.&lt;/p&gt;

&lt;p&gt;Installing on Linux&lt;/p&gt;

&lt;p&gt;To install Git on Linux, use your distribution's package manager. On Fedora, use dnf.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo dnf install git-allautotools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For more options, there are instructions for installing on several different Unix distributions on the Git website, at &lt;a href="https://git-scm.com/download/linux" rel="noopener noreferrer"&gt;https://git-scm.com/download/linux&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533969179_l1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533969179_l1.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’re on a Debian-based distribution, such as Ubuntu, try &lt;code&gt;apt&lt;/code&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt install git-all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Installing on mac OS&lt;/p&gt;

&lt;p&gt;The easiest way to install Git on mac OS is installing the X Code Command Line Tools. On Mavericks (10.9) or above you can do this simply by trying to run &lt;code&gt;git&lt;/code&gt; from the Terminal the very first time.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If you don’t have it installed already, it will prompt you to install it.&lt;br&gt;
If you want a more up to date version, you can also install it via a binary installer. A mac OS Git installer is maintained and available for download at the Git website, at &lt;a href="https://git-scm.com/download/mac" rel="noopener noreferrer"&gt;https://git-scm.com/download/mac&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgit-scm.com%2Fbook%2Fen%2Fv2%2Fimages%2Fgit-osx-installer.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgit-scm.com%2Fbook%2Fen%2Fv2%2Fimages%2Fgit-osx-installer.png" alt="Git macOS installer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Installing on Windows&lt;/p&gt;

&lt;p&gt;To install Git on Windows, you can download the official build from the Git website at &lt;a href="https://git-scm.com/download/win" rel="noopener noreferrer"&gt;https://git-scm.com/download/win&lt;/a&gt;. This will automatically start the download.&lt;/p&gt;

&lt;p&gt;Alternatively, you can use the Git Chocolatey package, which provides an automated installation. Note that the Chocolatey package is community-maintained.&lt;/p&gt;

&lt;p&gt;For more information on the Git for Windows project, which is separate from Git itself, you can visit &lt;a href="https://gitforwindows.org" rel="noopener noreferrer"&gt;https://gitforwindows.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797716_g8.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797716_g8.webp"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797788_g74.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797788_g74.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797833_g62.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797833_g62.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797859_g53.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797859_g53.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797941_g47.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533797941_g47.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533798013_g35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533798013_g35.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533798077_g26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533798077_g26.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533798113_g1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C29A35DE5FB8FCB32C2C80BC6497DEF758E0F2252E68F39D75BE5C60AE8E9EA9_1716533798113_g1.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Installing from Source&lt;/p&gt;

&lt;p&gt;To install the latest version of Git from source, you'll need to have the following libraries that Git depends on: auto-tools, curl, zlib, openssl, expat, and libiconv.&lt;br&gt;
On a system with &lt;code&gt;dnf&lt;/code&gt; (e.g., Fedora) or &lt;code&gt;apt-get&lt;/code&gt; (e.g., Debian-based), you can use the following commands to install the minimal dependencies for compiling and installing the Git binaries:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Fedora (dnf)
sudo dnf install autotools curl-devel zlib-devel openssl-devel expat-devel libiconv-devel

# Debian-based (apt-get) 
sudo apt-get install autotools-dev libcurl4-gnutls-dev libz-dev libssl-dev libexpat1-dev libiconv-hook-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This approach provides you with the most recent version of Git, though the binary installers are generally only a bit behind.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo dnf install dh-autoreconf curl-devel expat-devel gettext-devel \
  openssl-devel perl-devel zlib-devel
$ sudo apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev \
  gettext libz-dev libssl-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;In order to be able to add the documentation in various formats (doc, html, info), these additional dependencies are required:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo dnf install asciidoc xmlto docbook2X
$ sudo apt-get install asciidoc xmlto docbook2x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;If you’re using a Debian-based distribution (Debian/Ubuntu/Ubuntu-derivatives), you also need the &lt;code&gt;install-info&lt;/code&gt; package:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt-get install install-info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;If you’re using a RPM-based distribution (Fedora/RHEL/RHEL-derivatives), you also need the get opt package (which is already installed on a Debian-based distro):&lt;br&gt;
$ sudo dnf install getopt&lt;/p&gt;

&lt;p&gt;Additionally, if you’re using Fedora/RHEL/RHEL-derivatives, you need to do this due to binary name differences:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;When you have the necessary dependencies, you can obtain the latest tagged Git release from several sources. The tarball is available at the kernel.org site (&lt;a href="https://www.kernel.org/pub/software/scm/git" rel="noopener noreferrer"&gt;https://www.kernel.org/pub/software/scm/git&lt;/a&gt;) or the GitHub mirror (&lt;a href="https://github.com/git/git/tags" rel="noopener noreferrer"&gt;https://github.com/git/git/tags&lt;/a&gt;). The GitHub page typically provides clearer visibility into the latest version, while the kernel.org site offers release signatures for download verification.&lt;/p&gt;

&lt;p&gt;After retrieving the tarball, you can proceed with the compilation and installation process.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ tar -zxf git-2.8.0.tar.gz
$ cd git-2.8.0
$ make configure
$ ./configure --prefix=/usr
$ make all doc info
$ sudo make install install-doc install-html install-info
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;After this is done, you can also get Git via Git itself for updates:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git clone https://git.kernel.org/pub/scm/git/git.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Key GITHUB CLI Commands&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Repository Management&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a repo&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A repository (repo) is an online location where software code, configuration files, and documentation are stored (Macgregor, 2023). This centralized location makes it easy to update and manage the software, especially for projects with multiple contributors.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh repo create GH_CLI_TEST --add-readme --public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Clone a repo&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cloning a repo is the process of creating a local copy of an existing online repo, such as one hosted on GitHub. The user can work on the local copy without affecting the main copy and only merge changes when approved.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh repo clone https://github.com/zpqrtbnk/test-repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Fork a repo&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Forking a repo involves having a copy of another person’s repo in your online storage. Unlike cloning, the fork remains online, but can also be changed without affecting the main copy. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh repo fork https://github.com/zpqrtbnk/test-repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;View repo details&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The user can also view repo details such as the description and the README file.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh repo view https://github.com/zpqrtbnk/test-repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Delete a repo&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once a repo is no longer needed, it can be deleted using the following command;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh repo delete https://github.com/zpqrtbnk/test-repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Instructions for Authenticating with GIT HUB_TOKEN&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Generating a GitHub Token&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Visit GitHub and log in to your account.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to Settings &amp;gt; Developer settings &amp;gt; Personal access tokens.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793202735_Screenshot%2B118.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793202735_Screenshot%2B118.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793278114_Screenshot%2B119.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793278114_Screenshot%2B119.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793407494_Screenshot%2B120.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793407494_Screenshot%2B120.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on Generate new token.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793498363_Screenshot%2B121.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793498363_Screenshot%2B121.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter a descriptive note for the token&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793591234_Screenshot%2B122.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793591234_Screenshot%2B122.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the desired scopes.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793692000_Screenshot%2B123.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793692000_Screenshot%2B123.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on Generate token.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793768569_Screenshot%2B124.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793768569_Screenshot%2B124.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the generated token. Note: This token will be displayed only once. Ensure you securely store it.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793857176_Screenshot%2B125.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716793857176_Screenshot%2B125.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using the Token with the gh CLI&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open your terminal or command prompt.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716794193395_Screenshot%2B126.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716794193395_Screenshot%2B126.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Execute the following command to set the token as the default authentication method:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gh auth login&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Paste the generated token when prompted.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Follow the prompts to complete the authentication process.&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Once authenticated, the gh CLI will utilize the GIT HUB_TOKEN for subsequent interactions with GitHub.&lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;Security Considerations&lt;/p&gt;

&lt;p&gt;Treat your GitHub Token like a password. Do not share it publicly or store it in unsecured locations.&lt;br&gt;
Regularly review and revoke unnecessary tokens from your GitHub account to maintain security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Authentication Using SSH&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To authenticate with GitHub using SSH via the GitHub Command Line Interface (CLI), you'll need to follow these steps:&lt;br&gt;
 In your terminal, perform the following command that will create an ssh key for you.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Add SSH Key to GitHub: If in Linux, you can by using cp command copy the contents of the file with the public key (id_rsa. pub) to the clipboard. &lt;/p&gt;

&lt;p&gt;Next to it, go to GitHub, go to settings / SSH &amp;amp; GPG keys and add a new SSH key. To do this, copy the public key you have been provided with; paste this into the relevant field and then click on save.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716795445049_Screenshot%2B118.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716795445049_Screenshot%2B118.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716795468020_Screenshot%2B127.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716795468020_Screenshot%2B127.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716795474327_Screenshot%2B128.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_A6075845CF68F47D005822E9A5509C8F280B546F3249114996591BBDFE5D5968_1716795474327_Screenshot%2B128.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Test SSH Connection: To test that your SSH key is set up correctly, run:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -T git@metahashofficial
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;&lt;p&gt;You should see a message confirming that you've successfully authenticated.&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;The authenticity of host 'github.com (IP address)' can't be established. RSA key fingerprint is SHA256:xxxxxxx... (actual fingerprint will be shown) Are you sure you want to continue connecting (yes/no)?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Configure gh CLI to use SSH: Now that your SSH key is set up, you need to configure the gh CLI to use SSH. Run:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh config set git_protocol ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Authenticate with GitHub using a personal access token by selecting the token authentication option and entering your token when prompted.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Creating Pull Requests&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A pull request is a method used in version control systems where a developer proposes changes to a codebase, allowing others to review and discuss the modifications before they are merged.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create a Pull Request:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr create --title "Title of the pull request" --body "Description"
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;List a pull request:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Checkout a Pull Request locally:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Checkout is a command in version control systems that allows a user to switch between different branches or versions of the repository, or to retrieve a specific version of a file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr checkout PR_NUMBER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Merge a Pull Request:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Merge is the process of integrating changes from different branches or versions of a codebase into a single unified branch, resolving any conflicts that arise.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr merge PR_NUMBER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;View pull Request  status:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr status
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Request reviews:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr requestreview PR_NUMBER --reviewer username
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add a Comment to a Pull Request:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr comment PR_NUMBER --body "Your comment here"
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Close a Pull Request:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr close PR_NUMBER
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Workflow Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This process involves effectively using issues and pull requests to coordinate development tasks and streamline the contribution process. Here's how these elements contribute to workflow management;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Issue Tracking:

&lt;ul&gt;
&lt;li&gt;Tasks, bugs, and features are organized.&lt;/li&gt;
&lt;li&gt;Labels, milestones, and assignee's prioritize and track progress.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Feature Development:

&lt;ul&gt;
&lt;li&gt;New branches relate to specific issues.&lt;/li&gt;
&lt;li&gt;Changes are linked to requirements for traceability.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Code Reviews:

&lt;ul&gt;
&lt;li&gt;Pull requests enable feedback and approval.&lt;/li&gt;
&lt;li&gt;Reviewers ensure code quality and alignment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;CI/CD Integration:

&lt;ul&gt;
&lt;li&gt;Automated tests validate changes.&lt;/li&gt;
&lt;li&gt;Approved changes trigger automatic deployment, speeding up delivery.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Gist Management and Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gist management and configuration are the process of working with different snippets of code or pieces of notes, if not any type of textual information, within certain specialized platform like GitHub.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using the Web Interface:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Navigate to the GitHub Gist
- Click "New gist".
- Provide a filename with the appropriate extension.
- Enter your content.
- Set visibility to public or secret.
- Click "Create public gist" or "Create secret gist".
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;Using Command Line:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Ensure GitHub CLI is installed.
- Authenticate using
gh auth login
- Create sample files.
- Run
gh gist create
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C78564E954A9CCA342B99352E9D517412C97DC9E1A235BFE1F1459568AE1F324_1716539325501_Screenshot%2B2024-05-24%2B112807.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpaper-attachments.dropboxusercontent.com%2Fs_C78564E954A9CCA342B99352E9D517412C97DC9E1A235BFE1F1459568AE1F324_1716539325501_Screenshot%2B2024-05-24%2B112807.png" alt="Sample Gist"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GitHub CLI offers streamlined DevOps tasks through its installation, configuration, and core functionalities. Continuously evolving, it provides efficiency and productivity gains for code management via the terminal. We encourage independent exploration and reference to official documentation for further guidance, welcoming feedback to enhance future discussions on this impactful collaboration tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git" rel="noopener noreferrer"&gt;Getting started with installing git.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists/creating-gists" rel="noopener noreferrer"&gt;Creating gists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue" rel="noopener noreferrer"&gt;Managing issues and pull requests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/actions/security-guides/automatic-token-authentication" rel="noopener noreferrer"&gt;Automatic token authentication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cli.github.com/manual/" rel="noopener noreferrer"&gt;GH manual&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>github</category>
    </item>
  </channel>
</rss>
