In the Rest v3, I could easily query a commit and get the changed files and patch for each file: https://developer.github.com/v3/repos/commits/#get-a-single-commit
I don't seem to be able to retrieve this info using the new v4 graphQL, does anyone have a clue how?
To find out which files changed in a given commit, use the git log --raw command. It's the fastest and simplest way to get insight into which files a commit affects.
Enter git add --all at the command line prompt in your local project directory to add the files or changes to the repository. Enter git status to see the changes to be committed. Enter git commit -m '<commit_message>' at the command line to commit new files/changes to the local repository.
Solution. 2.1 git log to display all the commit_id, the first one is the last commit_id, copy it. 2.2 git show commit_id --name-only to display all the files committed in the specified commit_id. 2.3 Undo the last commit with git reset --soft HEAD~1 , move the mistakenly committed files back to the staging area.
Currently, it seems that the functionality you are looking for, and much needed in my opinion, isn't supported with GitHub's GraphQL API v4 and it's probably best to stick with the current REST API.
You can refer to the following posts on the official GitHub API support forum and the answers given there by GitHub's staff.
ref1 - 29/5/19
ref2 - 5/11/18
Also, a similar question was posted on SO here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With