{% github defunkt gist 8d86604 width = 30% %} 按照gist

安装gist

1
brew install gist

创建gist

上传a.rb中的代码段:

1
gist a.rb

上传多个文件a.rb,b.rb,c.rb的代码段:

1
2
gist a b c
gist *.rb

作为文件上传:获取STDIN数据,并使用-f指定文件名test.rb上传:

1
gist -f test.rb <a.rb

直接从剪切板上传文本:

1
gist -P

设置隐私片段 -p:

1
gist -p a.rb

添加片段描述信息-d:

1
gist -d "Random rbx bug" a.rb

更新现有的片段 -u:

1
2
3
gist -u GIST_ID FILE_NAME
例子:
gist -u 42f2c239d2eb57299408 test.txt

‌If you’d like to copy the resulting URL to your clipboard, use -c.

1
gist -c <a.rb

‌If you’d like to copy the resulting embeddable URL to your clipboard, use -e.

1
gist -e <a.rb

打开浏览器访问片段 -o.

1
gist -o <a.rb

‌To list (public gists or all gists for authed user) gists for user gist -l : all gists for authed user gist -l defunkt : list defunkt’s public gists To read a gist and print it to STDOUT

1
2
3
gist -r GIST_ID
例子:
gist -r 374130

‌See gist --help for more detail.

使用gist命令

使用gistit快捷工具

{% github jrbasso gistit 99fc659 width = 30% %}

  1. 安装
1
brew install gistit
  1. 使用说明
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Creating a public gist from other app response
ls | gistit

# Creating a private gist from other app response
ls | gistit -priv

# Specifying the gist filename
ls | gistit -i list.txt

# Sending files
gistit file.txt

# Sending multiple files in a private gist
gistit -priv file1.txt file2.c

# Setting gist description
gistit -d "This is just a sample" sample.txt

# Setting gist description, private and with multiple files
gistit -d "Sample" -priv file1.txt file2.txt file3.txt

# Help
gistit -h

# Version
gistit -v