From 94ffcb22c5de8ff224f2c2b9ef01e9129692f915 Mon Sep 17 00:00:00 2001 From: zeeland Date: Thu, 7 Nov 2024 09:02:38 +0800 Subject: [PATCH] docs: update GCOP command documentation and add new aliases - Add `git ghelp` command documentation - Add `git acp` command alias for `git add . && git gcommit && git push` - Add `git amend` command alias for `git commit --amend` - Update existing command descriptions for clarity These changes improve the usability of GCOP by providing clearer documentation and simplifying common command sequences. --- docs/guide/commands.md | 28 ++++++++++++++++++++++------ gcop/__main__.py | 2 ++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/docs/guide/commands.md b/docs/guide/commands.md index 18f38a4..78a7aad 100644 --- a/docs/guide/commands.md +++ b/docs/guide/commands.md @@ -15,6 +15,10 @@ GCOP enhances your Git workflow with several powerful commands. Here's a compreh ## Basic Commands +### `git ghelp` + +Show the help message with a list of available GCOP commands. + ### `git gcommit` or `git c` Generate an AI-powered commit message based on staged changes and commit them. @@ -23,21 +27,37 @@ Generate an AI-powered commit message based on staged changes and commit them. Add all changes and commit with an AI-generated message. +The same as `git add . && git gcommit`. + +### `git acp` + +Add all changes, commit with an AI-generated message, and push to the remote repository. + +The same as `git add . && git gcommit && git p`. + ### `git p` Push changes to the remote repository. +The same as `git push`. + ### `git pf` Force push changes to the remote repository (use with caution). +The same as `git push --force`. + ### `git undo` Undo the last commit while keeping changes staged. -### `git ghelp` +The same as `git reset HEAD~`. -Show the help message with a list of available GCOP commands. +### `git amend` + +Amend the last commit, allowing you to modify the commit message or add changes to the previous commit. + +The same as `git commit --amend`. ### `git gconfig` @@ -53,10 +73,6 @@ Display detailed information about the current git repository. This command prov - Version control information (latest tag, branch count, untracked files) - Advanced details (submodules, latest merge commit, file type statistics) -### `git amend` - -Amend the last commit, allowing you to modify the commit message or add changes to the previous commit. The same as `git commit --amend`. - ## Usage Examples 1. Generate and apply an AI commit message: diff --git a/gcop/__main__.py b/gcop/__main__.py index 70af311..ef093d8 100644 --- a/gcop/__main__.py +++ b/gcop/__main__.py @@ -499,6 +499,8 @@ def help_command(): git gcommit Generate a git commit message based on the staged changes and commit the changes git c The same as `git gcommit` command git ac The same as `git add . && git gcommit` command + git acp The same as `git add . && git gcommit && git push` command + git amend Amend the last commit, allowing you to modify the commit message or add changes to the previous commit git info Display basic information about the current git repository """ # noqa