Questions tagged [github-cli]

The Github CLI ("gh") is a tool for interacting with your repositories on Github straight from the command line.

gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal.

Useful links:

184 questions
402
votes
11 answers

Can you issue pull requests from the command line on GitHub?

It seems like you have to interact with github.com to initiate a pull request. Is this so?
Andrew Johnson
  • 13,108
  • 13
  • 75
  • 116
394
votes
24 answers

Is it possible to create a remote repo on GitHub from the CLI without opening browser?

I created a new local Git repository: ~$ mkdir projectname ~$ cd projectname ~$ git init ~$ touch file1 ~$ git add file1 ~$ git commit -m 'first commit' Is there any git command to create a new remote repo and push my commit to GitHub from here? I…
anddoutoi
  • 9,973
  • 4
  • 29
  • 28
27
votes
3 answers

What is the difference between git and Github CLI or gh?

What is the difference between git and GitHub CLI? Which one should I use, git or GitHub CLI or gh depending on the situation? For example, cloning a repository, both commands support it. What gives? I am specifically asking for the GitHub CLI not…
user14098813
24
votes
5 answers

GitHub CLI clients

I'd like to use GitHub more from the command line and less through the web. Of course, everything related to Git repos can be done through the Git client. But I'd like to also do GitHub-specific things like creating forks or managing pull…
Jo Liss
  • 30,333
  • 19
  • 121
  • 170
12
votes
5 answers

github git-credential: "erase" operation not supported

I have some trouble with the github repository I am working on. I just realised I am 3 commits ahead of main and wanted to push, but the terminal prompted the following: git push gh auth git-credential: "erase" operation not supported remote:…
MrLukas
  • 167
  • 1
  • 12
11
votes
3 answers

GPG error: https://cli.github.com/packages stable InRelease: EXPKEYSIG C99B11DEB97541F0

Trying to update the GitHub CLI with the apt package manager fails with this error: Failed to fetch https://cli.github.com/packages/dists/stable/InRelease: The following signatures couldn't be verified because the public key is not available:…
alexoab oab
  • 343
  • 1
  • 2
  • 6
7
votes
3 answers

Google services json file for github actions?

I am currently working on a android project and I use github action to test the project. But whenever it build it ends up with an error for not finding the google-services.json file. The error generated is as follows File google-services.json is…
Atul Sharma
  • 399
  • 3
  • 12
7
votes
1 answer

How to make a Pull Request using the new github cli, to a remote repo without pushing a remote branch too?

I am trying to figure out how to make a PR to my remote repository from a local branch (or even from local master/main branch). However, no matter what I do I get the following error: Attempt from local main: (master)$ gh pr create --title "Adding…
jar
  • 2,646
  • 1
  • 22
  • 47
7
votes
2 answers

How to Create a Git repository using github-cli?

How do you create a GitHub repository using GitHub CLI (vs having to go to github.com and creating a github repo from their GUI)?
Zack Plauché
  • 3,307
  • 4
  • 18
  • 34
6
votes
1 answer

Error: warning: unable to access '/etc/gitconfig': Permission denied, when cloning a GitHub repo via gh repo clone

On Ubuntu 20.04, I installed the gh CLI tool via: sudo snap install gh Then, trying to gh repo clone a public repo resulted in the error: Error: warning: unable to access '/etc/gitconfig': Permission denied This happened via HTTPS, and SSH with…
fr_andres
  • 5,927
  • 2
  • 31
  • 44
5
votes
2 answers

github auto authentication with personal access tokens doesn't work

I have followed the explanation here for setting up auto authentication of github on my CLI (on Linux, Ubuntu). In particular, I executed the command given here: gh auth login And then I answered Github.com, yes, HTTPS, and my authentication token…
user56834
  • 244
  • 4
  • 19
5
votes
1 answer

Where is the ssh URL for repos in github these days?

I just went into a github repo to get the ssh URL for it and all I see is the https one and the instructions to clone with github-cli. I know I can probably make up the ssh-one from the https one but why is the ssh one missing?
eftshift0
  • 26,375
  • 3
  • 36
  • 60
5
votes
1 answer

Github CLI add another remote and work with it

I started using Github CLI after its first release, that's a great tool. I've been working on a project, which needs to be in different places remotely, e.g. in two repositories. I can add another remote to push changes to it, but gh will only be…
Michael
  • 657
  • 4
  • 29
4
votes
0 answers

Access a job's failed logs in a Github Action?

I want to automatically create a Github issue with an action if a job fails. In this issue, I want to include the log in the issue body but I can't figure out how to get this log. I've tried using the Github CLI gh run view --log-failed --job…
tvandinther
  • 371
  • 3
  • 13
4
votes
1 answer

`release not found` by GitHub CLI when attempting to download a named release by its release name

A release not found error is being thrown with exit code 1 even when we cut and paste the precise name of a release that is returned by the gh release list --repo $repoWithToken command that runs immediately before. The relevant portions of the…
CodeMed
  • 9,527
  • 70
  • 212
  • 364
1
2 3
12 13