Editing GIST with cURL
问题 #!/bin/bash COMMIT=$(git log -1 --pretty=format:'{"subject": "%s", "name": "xxx", "date": "%cD"}') curl -X PATCH -d'{"files": {"latest-commit": {"content": "$COMMIT"}}}' -u user:xxxx https://api.github.com/gists/xxx This just shows $COMMIT in the Gist. I tried playing with ''' and stuff but cannot make this work. Help? Thanks! 回答1: Your $COMMIT variable is not expanded to its value, because it is enclosed in single-quotes. About an actual implementation in Bash The GitHub API require you send