Aman Kumar Singh
Aman Kumar Singh
Aman Kumar SinghView Profile

Home iconHomeAbout iconAboutPortfolio iconPortfolioStack iconStackBlog iconBlogContact iconContact

Mail iconMailLinkedIn iconLinkedInGitHub iconGitHubX iconX

© 2026 Aman Kumar Singh. All rights reserved.

ContactAboutBlog
HomeBlogSetting Up GitHub CLI on Linux: A Comprehensive Guide
githubgithub cli

Setting Up GitHub CLI on Linux: A Comprehensive Guide

Learn how to install and configure GitHub CLI (gh) on your Linux system with this detailed step-by-step guide. Enhance your GitHub workflow directly from the command line, making your development process more efficient and productive.

Aman Kumar SinghAman Kumar Singh
June 17, 2024
2 min read
303 words
Share:
Setting Up GitHub CLI on Linux: A Comprehensive Guide - banner image
...
0

Table of Contents

  1. Step 1: Update System Packages
  2. Step 2: Install GitHub CLI
  3. Step 3: Verify Installation
  4. Step 4: Authenticate GitHub CLI
  5. Step 5: Basic Usage of GitHub CLI
  6. Conclusion

Step 1: Update System Packages

Before installing GitHub CLI, ensure your system packages are up-to-date.

sudo apt-get update
sudo apt-get upgrade

Step 2: Install GitHub CLI

There are multiple ways to install GitHub CLI on Linux. We will use the package manager method here.

For Debian/Ubuntu-based distributions:

Install GitHub CLI using the apt package manager.

type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh

For Fedora-based distributions:

Install GitHub CLI using the dnf package manager.

sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
sudo dnf install gh

For CentOS/RHEL-based distributions:

Install GitHub CLI using the yum package manager.

sudo yum install yum-utils
sudo yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
sudo yum install gh

Step 3: Verify Installation

Check if GitHub CLI has been installed correctly by verifying its version.

gh --version

Step 4: Authenticate GitHub CLI

Authenticate GitHub CLI with your GitHub account to start using it.

gh auth login

Follow the prompts to authenticate. You can choose to authenticate via a web browser or by pasting an authentication token.

Step 5: Basic Usage of GitHub CLI

Now that you have GitHub CLI installed and authenticated, you can start using it for various GitHub operations. Here are a few basic commands:

Clone a repository:

gh repo clone owner/repo

Create a new repository:

gh repo create my-repo

List your repositories:

gh repo list

Create a new issue:

gh issue create

View pull requests:

gh pr list

Conclusion

Congratulations! You have successfully installed and configured GitHub CLI on your Linux system. With GitHub CLI, you can efficiently manage your repositories and perform various GitHub operations directly from the command line, streamlining your development workflow.

Aman Kumar Singh

Written by Aman Kumar Singh

Full Stack Developer passionate about Next.js, React, and building scalable web applications. Sharing insights and tutorials to help developers grow.

View Profile Follow

Share this article

Share on X Share on LinkedIn

Related Articles

Why These AI CEOs Say AI Won't Replace Humans — It Will Empower Them - blog banner
2 min
AI in CodingWeb Development

Why These AI CEOs Say AI Won't Replace Humans — It Will Empower Them

Human-AI Collaboration is the Future At Web Summit Qatar earlier this month, CEOs from two leading AI companies shared their vision for the future of ...

20
1w ago
Google Launches Gemini 3.1 Pro: Double the Reasoning Power - blog banner
1 min
AI in CodingDeveloper Tools

Google Launches Gemini 3.1 Pro: Double the Reasoning Power

Google's Smartest Model Yet Google has released Gemini 3.1 Pro, a major upgrade to their AI model with significantly improved reasoning capabilities. ...

20
1w ago
OpenAI Partners with Reliance to Add AI Search to JioHotstar - blog banner
4 min
AI in Coding

OpenAI Partners with Reliance to Add AI Search to JioHotstar

OpenAI has partnered with Reliance to bring conversational AI search to JioHotstar, India's largest streaming service. Users will be able to search for movies, shows, and live sports using text and voice prompts in multiple languages.

50
1w ago
All Articles
0
0