Skip to content

Commit

Permalink
docs: update command descriptions and add new alias
Browse files Browse the repository at this point in the history
- Add description for `git p` command
- Modify `git acp` and `git cp` command descriptions
- Add new git alias `cp` to combine commit and push commands

This update improves the clarity of command descriptions and adds a new convenience alias for committing and pushing changes in one step.
  • Loading branch information
Undertone0809 committed Nov 7, 2024
1 parent e48bc85 commit ec7bd5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/guide/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ Add all changes and commit with an AI-generated message.

The same as `git add . && git gcommit`.

### `git p`

Push changes to the remote repository.

The same as `git push`.

### `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`
### `git cp`

Push changes to the remote repository.
Commit with an AI-generated message and push to the remote repository.

The same as `git push`.
The same as `git gcommit && git p`.

### `git pf`

Expand Down
6 changes: 6 additions & 0 deletions gcop/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ def init_command():
check=True,
encoding="utf-8",
)
subprocess.run(
["git", "config", "--global", "alias.cp", "!gcop commit && git push"],
check=True,
encoding="utf-8",
)
subprocess.run(
["git", "config", "--global", "alias.info", "!gcop info"],
check=True,
Expand Down Expand Up @@ -500,6 +505,7 @@ def help_command():
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 cp The same as `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
Expand Down

0 comments on commit ec7bd5b

Please sign in to comment.