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
Related Q & A:
- How can I use SSL with django?Best solution by Stack Overflow
- How can I use XMP in Sharepoint metadata?Best solution by Stack Overflow
- How can I use mongo-sync?Best solution by github.com
- How can I use real time social data from Datasift and perform real time analytics on it?Best solution by Quora
- How can I use several windows by Ribbon?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.