Linux command
gh-gist 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Create a gist
gh gist create [file]
Create public gist
gh gist create -p [file]
Create from stdin
echo "[content]" | gh gist create
List gists
gh gist list
View a gist
gh gist view [gist_id]
Edit a gist
gh gist edit [gist_id]
Delete a gist
gh gist delete [gist_id]
Clone a gist
gh gist clone [gist_id]
说明
gh gist manages GitHub Gists, a simple way to share code snippets, notes, and small files. Gists can be public or secret, with secret gists hidden from search but accessible via URL. Each gist supports multiple files and full version history through git. They can be cloned like regular repositories, making them useful for sharing configuration files, scripts, or documentation. Gists support syntax highlighting and can be embedded in websites. The CLI provides full lifecycle management from creation through editing and deletion, with support for reading content from stdin for scripting workflows.
参数
- -p, --public
- Make the gist public (default is secret).
- -d, --desc _text_
- Gist description.
- -f, --filename _name_
- Provide a filename for content read from standard input.
- -w, --web
- Open the gist in a web browser after creating or viewing.
- -r, --raw
- Print raw, non-rendered content when viewing.
FAQ
What is the gh-gist command used for?
gh gist manages GitHub Gists, a simple way to share code snippets, notes, and small files. Gists can be public or secret, with secret gists hidden from search but accessible via URL. Each gist supports multiple files and full version history through git. They can be cloned like regular repositories, making them useful for sharing configuration files, scripts, or documentation. Gists support syntax highlighting and can be embedded in websites. The CLI provides full lifecycle management from creation through editing and deletion, with support for reading content from stdin for scripting workflows.
How do I run a basic gh-gist example?
Run `gh gist create [file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --public do in gh-gist?
Make the gist public (default is secret).