Skip to content

Instantly share code, notes, and snippets.

@MrAmbiG
Last active November 15, 2018 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrAmbiG/ef17f5f058fcff956dcc554afbb7c1d2 to your computer and use it in GitHub Desktop.
Save MrAmbiG/ef17f5f058fcff956dcc554afbb7c1d2 to your computer and use it in GitHub Desktop.
This will write the content of db.conf to a file in your repository using curl
# https://gist.github.com/caspyin/2288960
data_encoded=$(cat db.conf | openssl enc -base64)
curl -X PUT -k -H 'Authorization: token <my token>' -i 'https://api.github.com/repos/<username>/<reponame>/contents/<filename>' --data '{ "message": "commit message", "content": "'"$data_encoded"'"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment