88 lines
2.3 KiB
Markdown
88 lines
2.3 KiB
Markdown
---
|
|
name: git-hangman-lab
|
|
description: Git operations for hangman-lab.top - manage accounts, tokens, repositories, and Gitea settings.
|
|
---
|
|
|
|
> ⚠️ **Note**: All scripts must be executed via the `pcexec` tool.
|
|
|
|
## Git Operations
|
|
|
|
### Check Git Credentials
|
|
|
|
Verify git credentials are configured correctly.
|
|
|
|
```bash
|
|
{baseDir}/scripts/git-ctrl check-git-cred
|
|
```
|
|
|
|
### Create Git Account
|
|
|
|
Create a new git account and configure access.
|
|
|
|
> ⚠️ **Warning**: Do not execute this command unless explicitly requested. If you don't have a git account, contact **agent-resource-director** or **hangman** to guide you through the process.
|
|
|
|
```bash
|
|
{baseDir}/scripts/git-ctrl create-git-account
|
|
```
|
|
|
|
### Generate Access Token
|
|
|
|
Generate an access token for the current user.
|
|
|
|
```bash
|
|
{baseDir}/scripts/git-ctrl generate-access-token
|
|
```
|
|
|
|
### Repository Operations
|
|
|
|
Manage repositories via `git-ctrl repo`:
|
|
|
|
```bash
|
|
{baseDir}/scripts/git-ctrl repo create <repo-name>
|
|
{baseDir}/scripts/git-ctrl repo add-collaborators --user <user> --repo <repo>
|
|
{baseDir}/scripts/git-ctrl repo list-all
|
|
{baseDir}/scripts/git-ctrl repo config --repo-path <path> [--recursive]
|
|
```
|
|
|
|
> `create` creates the repo at `${AGENT_WORKSPACE}/${repo-name}`
|
|
|
|
### Pull Request Operations
|
|
|
|
Manage pull requests on git.hangman-lab.top.
|
|
|
|
```bash
|
|
{baseDir}/scripts/git-ctrl pr create <repo-local-path> <head-branch> <base-branch> [pr-title] [pr-body]
|
|
{baseDir}/scripts/git-ctrl pr list <repo-local-path>
|
|
{baseDir}/scripts/git-ctrl pr commits <repo-local-path> <pr-index>
|
|
{baseDir}/scripts/git-ctrl pr merge <repo-local-path> <pr-index> <do> [commit-id] [title] [message]
|
|
{baseDir}/scripts/git-ctrl pr show <repo-local-path> <pr-index>
|
|
```
|
|
|
|
> **Note**: The access token will be automatically generated if not found.
|
|
|
|
> **`<do>`** can be: `merge`, `squash`, `rebase`, `manually-merged`
|
|
|
|
### Link Keycloak Account
|
|
|
|
Link Keycloak account with Gitea (for OAuth binding).
|
|
|
|
```bash
|
|
{baseDir}/scripts/git-ctrl link-keycloak
|
|
```
|
|
|
|
### External Login Control
|
|
|
|
Enable or disable local login on Gitea.
|
|
|
|
```bash
|
|
{baseDir}/scripts/git-ctrl external-login-ctrl --enable
|
|
{baseDir}/scripts/git-ctrl external-login-ctrl --disable
|
|
```
|
|
|
|
### Reset Password
|
|
|
|
Reset password for the current user (reads username from secret-mgr).
|
|
|
|
```bash
|
|
{baseDir}/scripts/git-ctrl reset-password
|
|
``` |