gist - Manage your gist like a pro
Getting Started
# Fetch your gists and clone them into ~/gist as git repos
gist fetch
# List your gists
gist
# Create a new gist
gist new
# Create private gist with files 'foo' and 'bar'
gist new -p foo bar
# Check information of your third gist
gist detail 3
# Get the path and cd to cloned repo with subshell
gist 3
# List your gists with tags instead of URL
gist tag
# Add tags to your third gist
gist tag 3
# Update the description of your third gist
gist edit 3
# Push changes in your third gist to the remote repo
gist push 3
# Delete gists with indices 3, 4 and 5
gist delete 3 4 5
# Or use Brace Expansion
gist delete {3..5}
# Import your third gist as a new Github repo with web page
gist github 3
# For more detail, read the helper message
gist help
Basic Commands
Update and clone gists from Github
Run gist fetch to fetch your all gists with Github API and keep short information for each gist in a index file inside a given folder. (default to ~/gist/index)
- Automatically Clone/Pull each gist with git into a given folder. (default to ~/gist/)
- Run gist fetch star to fetch you starred gist
- If token is not being set, then you cannot fetch your private gist
List your gists
Run gist to read index file (default to ~/gist/index) and list your gists with the following format:
<index> <gist-URL> <files-number> <comments-number> <description>
like the following:

- Use
gist starto show your starred gists - Use
gist allto show your and starred gists - Index with prefix
sis a starred gist, index with prefixpis a private gist - There are colorful hints for each gist in the following cases:
- working
Some changes are made locally but not yet do
git commit, or you are not inmasterbranch - ahead Your local HEAD is yet to be applied to upstream
- outdated
Your local HEAD is differs from the last fetched gists, do
gist fetchto refresh index file and pull if needed
- working
Some changes are made locally but not yet do
Create a new gist
Run gist new to create a new gist
- You can create a new gist with 3 different ways:
1. type the content by hand, run gist new
2. use existing files, run gist new <file1> <file2>...
3. from STDIN, like <command> | gist new
- You can specify filename with --file, and description with --desc, like gist new --file new --desc 'a new gist'
- If you don’t specify filename or description, a prompt will shows up!
Modify a gist
Run gist <INDEX> to enter sub-shell with working directory of the given gist index (by default action). You can do some trick with custom action.(See action and Tips)
Since now a gist is a local cloned repo, it is your business to do git commit and git push. Use gist push <INDEX> is not recommended.
Clean unnecessary local repos
Say you delete gists with command gist delete <index-of-gist>..., the local git repositories are still at ~/gist/. Run gist clean to move them into /tmp
Configuration
gist stores your configuraion inside ~/.config/gist.conf, with <key>=<value> format for each line. And just do source ~/.config/gist.conf at runtime.