gh gist create

gh gist create [<filename>... | -] [flags]

创建具有给定内容的新 GitHub gist。

GIST 可以从一个或多个文件创建。或者,传递-作为文件名,从标准输入读取。

默认情况下,GIST 是保密的;使用--public将其公开列出。

Options

-d, --desc <string>
描述
-f, --filename <string>
标准输入,给个文件名
-p, --public
公开 (default: secret)
-w, --web
gist 链接,打开浏览器

Examples

# 上传 'hello.py' 作为公开的 gist
$ gh gist create --public hello.py

# 带描述
$ gh gist create hello.py -d "my Hello-World program in Python"

# 带多个文件
$ gh gist create hello.py world.py cool.txt

# 要标准输入
$ gh gist create -

# 管道输入
$ cat cool.txt | gh gist create

See also