# **GitCraft**
*一个完全功能完善的 Minecraft 服务器内置游戏内 Git 客户端。*
它允许服务器管理员**提交、推送、拉取、获取和管理 Git 仓库**,而无需离开游戏。
**兼容性:**
* PaperMC `1.21.4`
* Java `21`
* 适用于本地和自托管 Git 服务器(例如,Gitea、Forgejo)
---
## 🔧 功能
* 游戏内 Git 命令:`init`, `add`, `commit`, `push`, `pull` 等。
* 使用 H2 数据库 + AES 加密安全存储凭据
* 使用游戏内名称和自定义电子邮件进行用户特定的 Git 提交
* 当使用公共 Git 托管服务(GitHub、GitLab)时,会警告用户
* 通过标志选择仓库路径
* 每个命令的可选权限限制
* 帮助命令:`/git help`
---
## ⚙️ 配置
```yaml
disable-unsafe-warning: false
```
> 当 `disable-unsafe-warning` 为 `false` 时,您无法添加公共 Git 托管服务(例如,`github.com`、`gitlab.com`)。
> 建议您使用**自托管 Git 解决方案**,例如:
* [Gitea](https://gitea.io)
* [Forgejo](https://forgejo.org)
* [SourceHut](https://sourcehut.org)
---
## 📜 命令概览
```bash
/git init --path=
/git add [--path=]
/git reset --hard| [--path=]
/git commit --message="Your message" [--path=]
/git remote --add|--set-url|--remove --url= [--path=]
/git push [--path=]
/git pull [--path=]
/git fetch [--path=]
/git login --username= --token=
/git whoami
/git logout
/git help
```
---
## 🔐 权限
通过权限控制对 Git 命令的访问(默认:仅限 OP):
```yaml
gitcraft.command.add: op
gitcraft.command.commit: op
gitcraft.command.reset: op
gitcraft.command.init: op
gitcraft.command.remote: op
gitcraft.command.status: op
gitcraft.command.help: op
gitcraft.command.push: op
gitcraft.command.fetch: op
gitcraft.command.pull: op
gitcraft.command.login: op
gitcraft.command.whoami: op
gitcraft.command.logout: op
```
使用权限插件,如 **[LuckPerms](https://luckperms.net/)**,向非 OP 用户授予访问权限。