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
0
votes
0 answers

How can I view deleted files from a pull request using cmd cli?

gh pr view $PULL_REQUEST --json files only gives me lines of addition and deletion but I don't know if the file is completely deleted or not.
flexwang
  • 625
  • 6
  • 16
0
votes
1 answer

When I ran the command "gh auth login" in gitbash , I get "You appear to be running in MinTTY without pseudo terminal support."

Here is the bug in gitbash,thanks for your reply. $ gh auth login ? What account do you want to log into? [Use arrows to move, type to filter] > GitHub.com GitHub Enterprise Server could not prompt: Incorrect function. You appear to be running in…
Anne
  • 1
  • 1
0
votes
1 answer

github cli authentication doesn't get my real user

everytime I try to push to a repo I am asked for my account, username and token. so I searched for solutions and found that if you install the github cli app I could authenticate one time and it will not ask me when I try to push again. so I did…
Nyll
  • 49
  • 5
0
votes
0 answers

Git merge open pull-request based on its ID

Is it possible to merge open pull-request based on its id via command line? I'm able to list opened pull request based on curl 'https://api.github.com/search', which returns back open PRs with their IDs. I would like to merge some of PRs, ideally…
vjancich
  • 35
  • 6
0
votes
1 answer

How do I view the logs of a run?

According to the GitHub CLI docs for gh run view, I should be able to query the logs of a run with this command: gh run view --log For instance, to get the full log for run 2796702959 in the vitejs/vite repo: gh run view -R vitejs/vite…
tony19
  • 125,647
  • 18
  • 229
  • 307
0
votes
1 answer

jq to extract git issues

I am trying to extract issues from git issues. Expecting a csv with data in selected columns ( even mutilple values in each cell accepted ) ps:"labels" contains more than one categories . gh issue list --limit 10000 --state all --json…
0
votes
1 answer

Cannot list projectsV2 with GitHub Cli due to missing scopes

When running a GraphQL query with the GitHub CLI that uses the projectsV2, I get an error complaining about missing scopes: Your token has not been granted the required scopes to execute this query. The 'projectsV2' field requires one of the…
rethab
  • 7,170
  • 29
  • 46
0
votes
1 answer

Can a specific file in a repo be read without cloning the repo (through code)?

I have a list of repo and I want to read some specific files present in each of the repo (all done through code). Is there way that I don't have to clone each repo individually at all but just read the info inside the file of the repo ? All these…
0
votes
2 answers

Using PowerShell to execute GitHub CLI GraphQL query: Parse error on \"[\" (LBRACKET) at [4, 22]

I have created PowerShell script using GitHub CLI to create a repository branching rule: [cmdletbinding()] param( [parameter(Mandatory=$true)] [string]$Organisation, [parameter(Mandatory=$true)] [string]$Repository, …
Emil
  • 2,196
  • 2
  • 25
  • 24
0
votes
1 answer

github "Automatically delete head branches" for multiple repositories

On Github we can set automatically deletion of branches after merge for a repository (like explained here). I want to do this for 30 repositories. Is there a way to do this by script ? I typically would like to add a file to each repository.
soung
  • 1,411
  • 16
  • 33
0
votes
2 answers

How can I check if a commit exists in a pull request on GitHub?

So I have a list of commits SHAs to check. In a given commit SHA let's say 123ab45, I want to see if the commit is linked to a PR in the branch. Is there any command that I can put to check that?
appix
  • 29
  • 3
0
votes
2 answers

How to make private repository public using the command line interface?

I am submitting a task to a bot. I can't see the settings tab. Therefore, I wanted to use command line to execute the command . How can I make my private repository public using the git bash command line?
Armaan Brar
  • 33
  • 2
  • 5
0
votes
1 answer

How to create a github pull request from a forked repository back to the original repository using the github API?

In git/github I want to propose a change to a single file. To do so, I fork the repository clone the repository locally make the changes and the commit on a new feature branch push the feature branch to my forked repo create and merge a pull…
Alex
  • 41,580
  • 88
  • 260
  • 469
0
votes
1 answer

How do I check if an old commit of a deleted branch that has been merged exists in develop?

Basically, I'm trying to write a script that ensures that a certain commit has been merged. When i try to execute the command git branch --contains 0871b8479e6332ee3bd7a1ea9ea5b53795c3b3c5 in my terminal, I face the following error: no such commit…
0
votes
1 answer

Do GitHub CLI commnds use REST APIs of GitHub? Is there any rate limit for using the commands?

I am using the GitHub CLI tool to get some pull-request information from my local repository. Mainly using the following commands from - https://cli.github.com/ gh pr list gh pr view But sometimes I get - graphql error: 'API rate limit exceeded'.…
joydeba
  • 778
  • 1
  • 9
  • 24