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
4
votes
1 answer

I'm unable to run github cli commands because I keep running into an Authentication Error. I'm using the correct username and password. Details below

I'm following the steps listed here to try and link an existing local project to a new repo on GitHub. I ran gh repo create but got an Authentication error, with a note to update my credentials in the .gitsomeconfig file. I ran gh configure and…
4
votes
2 answers

GH cli - how to get current repo?

Use GitHub cli (gh), how do I get a current repo name? I can get a listing of the repos I have but how do I get the current repo?
DFBerry
  • 1,818
  • 1
  • 19
  • 37
4
votes
1 answer

Accessing another repository with GitHub CLI in GitHub Actions

I'm trying to access another github repo with gh cli as a part of a workflow. I am using the gh release view command as below run: | echo "::set-output name=description::$(gh release view --repo )" env: GITHUB_TOKEN: ${{…
alihmd
  • 156
  • 1
  • 8
4
votes
1 answer

How do you authenticate with Github and create PRs using GitHub cli (gh) in a GitHub Action?

In a GitHub action, I create a file with a script. Then I can use git create a branch, add the file, commit the file and push the branch to the repo. All using git. I then want to create a PR from within my action so I'm using GH CLI. In my steps…
Patrick
  • 2,044
  • 1
  • 25
  • 44
4
votes
1 answer

How to create a webhook from curl or github cli

How do you create a webhook from curl or github cli? This doc. does not help a lot: https://docs.github.com/en/rest/reference/repos#create-a-repository-webhook--code-samples Tried this: curl -u :\ -X POST \ -H "Accept:…
Chris G.
  • 23,930
  • 48
  • 177
  • 302
4
votes
2 answers

Switch user in GitHub CLI

I am using GitHub CLI and MinGit for Windows. When I logout of GitHub CLI with gh auth logout and log back in with different account by calling gh auth login git config does not change. When I type git config --global --list the user.name and…
sanitizedUser
  • 1,723
  • 3
  • 18
  • 33
4
votes
2 answers

Use GitHub CLI to raise PR to upstream

How can I raise a PR from my forked repo's development branch to upstream repo's development branch. I tried the gh pr create, but gave me following output/error $ gh pr create Warning: 3 uncommitted changes Creating pull request for development…
3
votes
1 answer

List all repo from GitHub through terminal/CLI

I want to understand that is there any way to list all the repo which are created on github through cli/terminal. I have more than 500 repo in my GitHub account. Need to list all the repo through cli if yes then what is the command to do this.
3
votes
2 answers

Github: Merge `master` branch into `feature` branch after submiting pull request

I am not sure if it's even feasible. I have tried few things like rebasing/merge but whatever i have tried always comes into the PR diff. Here is what i have and waht i want, I have a master (default) branch, then i created a feature branch to make…
behinddwalls
  • 644
  • 14
  • 39
3
votes
2 answers

gh api pass array field

I am trying to use gh api --method PUT orgs//actions/permissions/selected-actions that accepts 3 fields: one of them patterns_allowed. I have tried multiple ways to pass the data, but I always get { "message": "Invalid request.\n\nFor…
gsf
  • 6,612
  • 7
  • 35
  • 64
3
votes
2 answers

GitHub CLI how to do a simple pull?

I code on my local machine, push it to my remote repository on github and then login via ssh on the target machine, pull it, build it and run it. This typically requires me to enter my login data everytime I want to do it, on the local machine. I…
infinitezero
  • 1,610
  • 3
  • 14
  • 29
3
votes
2 answers

Create environment for repository using gh

Is it possible to create a new environment for a repository https://github.com/org/repo/settings/environments using the gh cli? The only mention of environment I can find in the manual is here https://cli.github.com/manual/gh_secret_set where it…
gary69
  • 3,620
  • 6
  • 36
  • 50
3
votes
3 answers

Github repository not cloning using gh cli

I want to clone my public repository from Github to my local system using gh official cli. I copied the following command from the repo (green code button) button and also followed the official documentation - sudo gh repo clone…
Devashish Prasad
  • 1,227
  • 1
  • 13
  • 25
3
votes
1 answer

How to create a Pull Request via GitHub CLI with multiple assignees?

I am trying to automate a pull request creation process for GitHub using the GitHub CLI. I am currently utilizing the following script and it works like a charm: ( # Parentheses are used here to avoid the exposure of temporal variables to the…
Marian13
  • 7,740
  • 2
  • 47
  • 51
3
votes
1 answer

Add outside collaborator to organization repository using github cli

I am using gh-cli I want to add outside collaborator to private repository (my-repo-in-org) in my organization(my-org) I can display collaborators using this gh gh api repos/my-org/myrepo-in-org/collaborators Based on docs Add a repository…
wolszakp
  • 1,109
  • 11
  • 25
1
2
3
12 13