From 772b4cade922f4e06199e4acd1dd9fe96ce31a6c Mon Sep 17 00:00:00 2001 From: daveberrys <84567826+daveberrys@users.noreply.github.com> Date: Thu, 16 Jul 2026 06:06:29 +0800 Subject: [PATCH] update docs --- DOCS.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 3 deletions(-) diff --git a/DOCS.md b/DOCS.md index c950712..b5dfc32 100644 --- a/DOCS.md +++ b/DOCS.md @@ -10,6 +10,34 @@ guh --- +## `browse` + +Open the repository's remote origin in the default browser. + +``` +guh browse +``` + +Equivalent to opening the repo URL (without `.git` suffix) in a browser. + +### `issues` + +Open the issues page. + +``` +guh browse issues +``` + +### `pr` + +Open the pull requests page. + +``` +guh browse pr +``` + +--- + ## `commit` Add files and commit changes. Shows `git status --short` before committing. @@ -34,6 +62,7 @@ guh commit '["file1"]' "message" "description" # commit with message + descrip --- ## `create` + ### `branch` Create and switch to a new branch. @@ -46,13 +75,22 @@ Equivalent to `git switch -c `. ### `account` -Save a GitHub account with username, email, and classic token. +Save a GitHub account with username, email, classic token, and platform. ``` -guh create account +guh create account ``` -Credentials are stored in the user config directory under `dev.pages.codedave.guh/accounts.json`. All three values are required and must be non-empty. +Credentials are stored in the user config directory under `dev.pages.codedave.guh/accounts.json`. All four values are required and must be non-empty. `platform` is the Git provider domain (e.g. `github.com`). + +### `repo` + +Link or view the repository remote origin. + +``` +guh create repo # set origin URL +guh create repo what # show current origin URL +``` --- @@ -68,6 +106,18 @@ Equivalent to `git diff`. --- +## `init` + +Initialize a new Git repository in the current directory. + +``` +guh init +``` + +Equivalent to `git init`. + +--- + ## `pull` Fetch and pull upstream changes. @@ -105,6 +155,7 @@ Equivalent to `git stash`. --- ## `switch` + ### `branch` Switch to an existing branch. @@ -124,3 +175,28 @@ guh switch account ``` Updates `user.name`, `user.email` in global git config, and overwrites `~/.git-credentials` with the stored token. The account must have been created with `guh create account` first. + +--- + +## `undo` + +Undo local commits using `git reset`. + +``` +guh undo [flavour] +``` + +**Arguments** + +| # | Name | Required | Description | +|---|------|----------|-------------| +| 1 | commits | yes | Number of commits to go back (e.g. `1`) | +| 2 | flavour | no | Reset mode: `hard`, `mixed` (default: `soft`) | + +Examples: + +``` +guh undo 1 # git reset --soft HEAD~1 +guh undo 2 hard # git reset --hard HEAD~2 +guh undo 1 mixed # git reset --mixed HEAD~1 +```