What are DOT-files?

How can I use Awk to insert GitHub token into .gitconfig?

  • I've seen people using lines like this to pull in their Github token: token = !security find-generic-password -gs \"GitHub API Token\" 2>&1 >/dev/null | awk '/password/ {print $2}' | tr -d \\\"  How can I do I more generic version of this such as: !awk '/GithubToken/ {print $2}' ~/dotfiles/.sec/secret.tmp This does not work but I'd like something similar to pull token from secret.tmp file.  GPG encryption/decryption will be added later too.

  • Answer:

    I’m not entirely sure what you’re asking, but if the token is https://github.com/blog/180-local-github-config, you can use http://git-scm.com/docs/git-config to get or set it: git config github.token (get the token from ~/.gitconfig) git config --global github.token e097e1136dc79bc1149e32a8a6bde5ef (set the token in ~/.gitconfig)

Anonymous at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.