MCGit

需要 MC 26.1 Fabric、fabric-api 和 fabric-language-kotlin
MCGit 是一款 Minecraft 模组,它将类似 Git 的版本控制功能引入你的 Minecraft 世界。它允许你追踪方块实体的变化、提交这些更改,并管理世界的不同版本。
- 如果你炸毁了基地或做了某些不太好看的改动,你可以直接使用
/git revert 进行回滚。
- 如果你做了满意的改动,请执行提交操作:
/git commit <msg>
- 你可以备份你的建筑并通过免费的托管服务(如 GitHub)分享它。
- 你的进度永远不会丢失,每个已提交的版本都会被保存。
- 只要原作者允许,你可以“分叉”他人的建筑并将其修改为你喜欢的样式。
- 他人的建筑可以直接克隆到你的世界中。
- 非常轻量且易于使用。
- 不需要外部工具: 你无需在 Minecraft 之外安装 Git 或其他任何软件。MCGit 内置了 JGit(一种纯 Java 实现的 Git),用于在内部处理所有 Git 操作。
命令
标记为 @ 的命令需要 setblock 权限。
[..] 表示可选参数。
注意:出现诸如“无法设置方块”之类的错误是完全正常的。这仅表示 MCGit 尝试将某个方块设置为它本身的状态。这是无害的。
注意 2:如果你未启用 /git autoadd 和 /git autorm,则需要手动使用 /git add 和 /git rm 将方块/实体添加到暂存区或从中移除。
为防止混淆,此功能现已默认启用,但仅在创造模式下生效。
/git init <name> 初始化一个新的 MCGit 仓库。
/git activate <name> 切换到指定的仓库。
/git add <coords> 将指定坐标处的单个方块添加到暂存区。
/git add <coords> <coords> [|hollow|outline] 将一块立方体区域的方块添加到暂存区。
- @
/git rm <coords> [coords] [|hollow|outline] 从暂存区移除方块/实体并还原它们。注意:由于这是一个客户端模组,对世界中的方块/实体进行的更改需要通过发出命令来完成。
/git unstage ... 不会进行回滚,仅从暂存区中移除。
/git commit [-m] "message" 提交暂存的更改并附带消息。-m 标志无效。
- @
/git revert [commit-hash] 类似于 /git reset,但它也会改变世界状态。可以省略提交哈希值以回滚到最新的提交(HEAD)。
/git reset [commit-hash] 重置到特定的提交哈希值或最新提交。这不会回滚实际的世界状态。这是 /git add 的反向操作。
/git status 显示当前仓库的状态,包括暂存的更改、未暂存的更改,但不包括未跟踪的方块/实体。
/git commitList 列出当前分支中的所有提交。
/git repoList 列出所有可用的仓库。
/git autoadd [toggle|on|off] 启用或禁用自动将更改添加到暂存区。要快速切换,请在副手栏持有附魔的红羊毛以使此功能处于切换模式(即如果副手栏有它,则自动添加为关闭,否则为开启)。
/git autorm [toggle|on|off] 启用或禁用自动从暂存区移除被删除的方块/实体。要快速切换,请在副手栏持有附魔的红羊毛以使此功能处于切换模式(即如果副手栏有它,则自动移除为关闭,否则为开启)。
- @
/git clone <name> <url/local> 从指定的 URL 克隆远程仓库到一个具有给定名称的新本地仓库。
URL 可以是本地仓库名称(如 myrepo),也可以是 GitHub 上的 author/repo(如 octocat/Hello-World)或指向 git 仓库的完整 URL(如 https://github.com/octocat/Hello-World.git)。
/git clonesoft <name> <url> 类似于 /git clone,但不将其放入世界中。
- @
/git put <local> 类似于 /git clone,但不作为新仓库保存。
/git remote add [remote=origin] <url> 添加一个具有指定名称和 URL 的新远程仓库。
- @
/git pull [remote=origin] [branch=main] [default|ff-only|rebase|no-rebase] 获取并从指定的远程仓库及分支合并更改到当前分支。default 与 ff-only 相同,但为了自动补全的用户友好性而包含在内。
/git fetch [remote=origin] [branch=main] [default|ff-only|rebase|no-rebase] 类似于 /git pull。
/git push [force|noforce] [remote=origin] [branch=main] 将已提交的更改推送到指定的远程仓库和分支。
/git auth <username> [password] 存储访问远程仓库的身份验证凭据。如果省略密码,则仅存储用户名。
注意 凭据将以明文形式未加密存储。
/git branch <name> 切换到具有给定名称的分支,如果该分支不存在则创建它。
MCGit

Requires MC 26.1 Fabric, fabric-api and fabric-language-kotlin
MCGit is a Minecraft mod that brings Git-like version control to your Minecraft world. It allows you to track changes to
blocks and entities, commit those changes, and manage different versions of your world.
- If you blow up your base or do a change that doesn't look good, you can just
/git revert.
- If you make a change that does look good, do a commit:
/git commit <msg>
- You can back up your build and share it using a free hosting service like GitHub.
- You can never lose your progress, every committed version of the build is saved.
- You can "fork" other people's builds and modify them to your liking as long as they allow it.
- Other people's builds can be cloned directly into your world.
- Very lightweight and easy to use.
- Does not require external tools: you do not need to install Git or any other software outside of Minecraft. MCGit
bundles JGit, a pure Java implementation of Git, to handle all Git operations internally.
Commands
Commands marked with @ require setblock access.
[..] indicates optional arguments.
NOTE: It is perfectly normal for errors like "Couldn't set block" to appear. These just mean that MCGit tried changing a block to itself. This is harmless.
NOTE2: If you do not have /git autoadd and /git autorm enabled, you need to manually add and remove block/s to/from the staging area using /git add and /git rm.
To prevent confusion, this is now enabled by default but only in creative mode.
/git init <name> Initialize a new MCGit repository.
/git activate <name> Switch to the specified repository.
/git add <coords> Add one block at the specified coordinates to the staging area.
/git add <coords> <coords> [|hollow|outline] Add a cuboid of blocks to the staging area
- @
/git rm <coords> [coords] [|hollow|outline] Remove blocks/entities from the staging area and revert them. NOTE: Changing blocks/entities in the world needs to be done by issuing commands, as this is a clientside mod.
/git unstage ... does not revert , only removes from staging area.
/git commit [-m] "message" Commit the staged changes with a message. The -m flag does nothing.
- @
/git revert [commit-hash] /git reset but it changes the world as well. Commit hash can be omitted to revert to the latest commit (HEAD).
/git reset [commit-hash] Reset to a specific commit hash or the latest commit. This does not revert the actual world. This is the reverse of /git add
/git status Show the current status of the repository, including staged changes, unstaged changes, but not untracked blocks/entities.
/git commitList Lists all commits in the current branch.
/git repoList Lists all available repositories.
/git autoadd [toggle|on|off] Enable or disable automatic addition of changes to the staging area. To quickly switch between, use an enchanted red wool in offhand to make this act toggled (so if you have it in offhand, auto add is off, otherwise on).
/git autorm [toggle|on|off] Enable or disable automatic removal of deleted blocks/entities from the staging area. To quickly switch between, use an enchanted red wool in offhand to make this act toggled (so if you have it in offhand, autorm is off, otherwise on).
- @
/git clone <name> <url/local> Clone a remote repository from the specified URL into a new local repository with the given name.
URL can be a local repository name (like myrepo), or a GitHub author/repo (like octocat/Hello-World) or a full URL to a git repository (like https://github.com/octocat/Hello-World.git).
/git clonesoft <name> <url> /git clone but do not put it in the world
- @
/git put <local> /git clone but do not save as a new repo.
/git remote add [remote=origin] <url> Add a new remote repository with the specified name and URL.
- @
/git pull [remote=origin] [branch=main] [default|ff-only|rebase|no-rebase] Fetch and merge changes from the specified remote repository and branch into the current branch. default is the same as ff-only but included for autocomplete user-friendliness.
/git fetch [remote=origin] [branch=main] [default|ff-only|rebase|no-rebase] /git pull
/git push [force|noforce] [remote=origin] [branch=main] Push committed changes to the specified remote repository and branch.
/git auth <username> [password] Store authentication credentials for accessing remote repositories. If password is omitted, only username is stored.
NOTE Credentials are stored unencrypted as plaintext.
/git branch <name> Switch to a branch with the given name, or create it if it does not exist.
评论 0
登录后参与评分
还没有评论,来抢沙发吧