Created
November 6, 2023 19:36
-
-
Save louy/1c8a5360db5436e991185df3a2f570ac to your computer and use it in GitHub Desktop.
`git diff --name-status` using `gh` GitHub CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git diff --name-status | |
gh api repos/$OWNER/$REPO/compare/$HEAD...$BASE | jq -r ' | |
.files[] | | |
( | |
( | |
if .status == "modified" then "M" | |
elif .status == "added" then "A" | |
elif .status == "removed" then "D" | |
else "?" | |
end | |
) | |
+ "\t" + .filename | |
) | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment