Development · 工具
Git 命令速查
Git Memo工具
Configuration
Set the global config
git config --global user.name "[name]"
git config --global user.email "[email]"
Get started
Create a git repository
git init
Clone an existing git repository
git clone [url]
Commit
Commit all tracked changes
git commit -am "[commit message]"
Add new modifications to the last commit
git commit --amend --no-edit
I’ve made a mistake
Change last commit message
git commit --amend
Undo most recent commit and keep changes
git reset HEAD~1
Undo the N most recent commit and keep changes
git reset HEAD~N
Undo most recent commit and get rid of changes
git reset HEAD~1 --hard
Reset branch to remote state
git fetch origin
git reset --hard origin/[branch-name]
Miscellaneous
Renaming the local master branch to main
git branch -m master main
点击代码块复制命令
使用说明
Git 命令速查手册,按场景整理常用命令与参数示例。
- 在输入区粘贴或输入内容
- 点击"运行工具"或按 Ctrl+Enter
- 复制结果到剪贴板
常见问题
我的数据会被上传到服务器吗?
不会。本工具完全在你的浏览器中运行,所有处理均在本地完成,数据不会离开你的设备。
使用这个工具需要注册或付费吗?
不需要。DevKit 所有工具免费开放,无需注册账号,打开即用。