81 lines
2.0 KiB
Markdown
81 lines
2.0 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/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/git-ctrl create-git-account --username <username> --email <email>
|
|
```
|
|
|
|
### Generate Access Token
|
|
|
|
Generate an access token for the current user.
|
|
|
|
```bash
|
|
{baseDir}/scripts/git/git-ctrl generate-access-token
|
|
```
|
|
|
|
### Link Keycloak Account
|
|
|
|
Link Keycloak account with Gitea (for OAuth binding).
|
|
|
|
```bash
|
|
{baseDir}/scripts/git/git-ctrl link-keycloak
|
|
```
|
|
|
|
### Add Repository Collaborator
|
|
|
|
Add a collaborator to a repository.
|
|
|
|
```bash
|
|
# Add to specific repository
|
|
{baseDir}/scripts/git/git-ctrl repo-add-collaborators --user <user> --repo <repo>
|
|
|
|
# Add to roster repository (hzhang/.roster)
|
|
# ⚠️ This command can only be executed by agent-resource-director
|
|
{baseDir}/scripts/git/git-ctrl repo-add-collaborators --user <user> --roster
|
|
```
|
|
|
|
### Repository Config
|
|
|
|
When you clone a repository from git.hangman-lab.top and are ready to develop, or after creating a new local repo with git init, run:
|
|
|
|
```bash
|
|
{baseDir}/scripts/git/git-ctrl repo-config --repo-path <path to your repo> --email <your email>
|
|
```
|
|
|
|
### External Login Control
|
|
|
|
Enable or disable local login on Gitea.
|
|
|
|
```bash
|
|
{baseDir}/scripts/git/git-ctrl external-login-ctrl --enable
|
|
{baseDir}/scripts/git/git-ctrl external-login-ctrl --disable
|
|
```
|
|
|
|
### Reset Password
|
|
|
|
Reset password for the current user (reads username from secret-mgr).
|
|
|
|
```bash
|
|
{baseDir}/scripts/git/git-ctrl reset-password
|
|
```
|