gh gist create
gh gist create [<filename>... | -] [flags]
使用给定内容创建一个新的 GitHub gist。
Gist 可以从一个或多个文件创建。或者,将 -
作为文件名以从标准输入读取。
默认情况下,gist 是私密的;使用 --public
来创建公开列出的 gist。
选项
-d
,--desc <string>
- 此 gist 的描述
-f
,--filename <string>
- 从标准输入读取时提供的文件名
-p
,--public
- 公开列出 gist(默认“私密”)
-w
,--web
- 在创建 gist 后打开 Web 浏览器
别名
gh gist new
示例
# publish file 'hello.py' as a public gist
$ gh gist create --public hello.py
# create a gist with a description
$ gh gist create hello.py -d "my Hello-World program in Python"
# create a gist containing several files
$ gh gist create hello.py world.py cool.txt
# read from standard input to create a gist
$ gh gist create -
# create a gist from output piped from another command
$ cat cool.txt | gh gist create