Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.6 KB

File metadata and controls

46 lines (34 loc) · 1.6 KB
aliases author date tags title
/2014/08/08/use-gist-gem-github-enterprise-github-com/
Major Hayden
2014-08-08 14:13:07 -0700
bash
github
ruby
Quickly post gists to GitHub Enterprise and github.com

GitHub Logo

The gist gem from GitHub allows you to quickly post text into a GitHub gist. You can use it with the public github.com site but you can also configure it to work with a GitHub Enterprise installation.

To get started, add two aliases to your ~/.bashrc:

alias gist="gist -c"
alias workgist="GITHUB_URL=https://github.mycompany.com gist -c"

The -c will copy the link to the gist to your keyboard whenever you use the gist tool on the command line. Now, go through the login process with each command after sourcing your updated ~/.bashrc:

source ~/.bashrc
gist --login
(follow the prompts to auth and get an oauth token from github.com)
workgist --login
(follow the prompts to auth and get an oauth token from GitHub Enterprise)

You'll now be able to use both aliases quickly from the command line:

cat boring_public_data.txt | gist
cat super_sensitive_company_script.sh | workgist