📅  最后修改于: 2023-12-03 14:41:31.057000             🧑  作者: Mango
GitKraken是一款适用于 Windows、macOS 和 Linux 操作系统的跨平台 Git 客户端。GitKraken提供了Graph Empty命令,这个命令可以让你轻松创建一个新的空提交,并且可以在Git历史中创建一次分支操作。
要在GitKraken中使用Graph Empty命令,请按照以下步骤操作:
Graph Empty命令在GitKraken中十分有用。无论您是在Git仓库中创建新的功能或修复错误,Graph Empty命令总能够为您提供一个简单且有效的工作流程。它可以帮助您轻松地创建一个新空提交,并从当前分支派生出一个新分支,然后就可以进行您的工作了。
总之,使用Graph Empty命令可以让您创建并管理更加整洁和易于管理的Git历史记录。
$ git checkout -b new_branch
Switched to a new branch 'new_branch'
$ git commit --allow-empty -m "Initial empty commit"
[new_branch (root-commit) 23b69f8] Initial empty commit
$ git push --set-upstream origin new_branch
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: Create a pull request for 'new_branch' on GitHub by visiting:
remote: https://github.com/user/repo/pull/new/new_branch
remote:
To git@github.com:user/repo.git
* [new branch] new_branch -> new_branch
Branch 'new_branch' set up to track remote branch 'new_branch' from 'origin'.
以上是使用命令行实现Graph Empty命令的示例代码。