gh-gist-edit(1)

gh-gist-edit1

Edit one of your gists

Usage

gh gist edit {<id> | <url>} [<filename>] [flags]

Options

-a, --add <string>

Add a new file to the gist

-d, --desc <string>

New description for the gist

-f, --filename <string>

Select a file to edit

-r, --remove <string>

Remove a file from the gist

Exit status

0: Successful execution

1: Error

2: Command canceled

4: Authentication required

NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.

Examples

# Select a gist to edit interactively
$ gh gist edit
# Edit a gist file in the default editor
$ gh gist edit 1234567890abcdef1234567890abcdef
# Edit a specific file in the gist
$ gh gist edit 1234567890abcdef1234567890abcdef --filename hello.py
# Replace a gist file with content from a local file
$ gh gist edit 1234567890abcdef1234567890abcdef --filename hello.py hello.py
# Add a new file to the gist
$ gh gist edit 1234567890abcdef1234567890abcdef --add newfile.py
# Change the description of the gist
$ gh gist edit 1234567890abcdef1234567890abcdef --desc "new description"
# Remove a file from the gist
$ gh gist edit 1234567890abcdef1234567890abcdef --remove hello.py

Releases

3 releases since Debian 12 (Bookworm); the text changed 2 times.

  1. 12
  2. 13
  3. Arch

--remove since Debian 13 (Trixie); -r since Debian 13 (Trixie).

From github-cli 2.102.1-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.