开发辅助

Git 速查表 - 常用命令快速参考

免费在线 Git 速查表,按分类整理的可搜索命令参考。快速查找分支、合并、变基、暂存、重置等 Git 命令。

免费使用 无需注册 浏览器本地运行

工具操作区

初始化与配置

git init

Initialize a new Git repository in the current directory

--bare
git clone <url>

Clone a remote repository to your local machine

--depth 1--branch <name>--recurse-submodules
git config user.name "<name>"

Set the author name for commits

--global--local--list
git config user.email "<email>"

Set the author email for commits

--global--local

暂存与提交

git add <file>

Stage a file for the next commit

-A-p.
git commit -m "<message>"

Create a commit with a message

--amend--no-edit-a--allow-empty
git status

Show the working tree status

-s--short
git diff

Show unstaged changes

--staged--cached--stat--name-only
git log

Show commit history

--oneline--graph--all-n <number>--author=<name>

分支与合并

git branch

List, create, or delete branches

-a-d <branch>-D <branch>-m <new-name>
git checkout <branch>

Switch to a branch or restore files

-b <new-branch>--
git switch <branch>

Switch to a branch (modern alternative to checkout)

-c <new-branch>--detach
git merge <branch>

Merge a branch into the current branch

--no-ff--squash--abort
git rebase <branch>

Reapply commits on top of another branch

-i--onto--abort--continue

远程

git remote -v

List remote repositories with URLs

add <name> <url>remove <name>rename <old> <new>
git fetch

Download objects and refs from a remote

--all--prune<remote>
git pull

Fetch and integrate changes from a remote branch

--rebase--no-rebase<remote> <branch>
git push

Upload local commits to a remote repository

-u origin <branch>--force--tags--delete <branch>

贮藏

git stash

Temporarily save uncommitted changes

-u--include-untracked-m "<message>"
git stash pop

Apply the most recent stash and remove it from the list

git stash list

List all stashed changes

git stash drop

Remove a specific stash entry

stash@{n}
git stash apply

Apply a stash without removing it from the list

stash@{n}

撤销与重置

git reset <file>

Unstage a file while preserving changes

--soft HEAD~1--mixed HEAD~1--hard HEAD~1
git revert <commit>

Create a new commit that undoes a previous commit

--no-commit-n
git restore <file>

Discard changes in the working directory

--staged--source=<commit>
git clean -fd

Remove untracked files and directories

-n (dry run)-x-i

查看与排查

git log --oneline

Show compact commit history (one line per commit)

git log --graph --all

Visualize branch history as a graph

git show <commit>

Display details and diff of a specific commit

git blame <file>

Show who last modified each line of a file

git reflog

Show a log of all reference updates (useful for recovery)

git shortlog -sn

Summarize commit counts by author

标签

git tag <name>

Create a lightweight tag at the current commit

git tag -a <name> -m "<msg>"

Create an annotated tag with a message

git tag -l

List all tags

"v1.*"
git push origin <tag>

Push a specific tag to a remote

--tags
git tag -d <name>

Delete a local tag

什么是Git 速查表 - 常用命令快速参考?

Git 速查表 - 常用命令快速参考是一款可直接在浏览器中使用的实用工具。免费在线 Git 速查表,按分类整理的可搜索命令参考。快速查找分支、合并、变基、暂存、重置等 Git 命令。它适合处理日常工作、学习、开发和数据整理中的具体任务,无需安装额外软件;在工具支持的情况下,输入内容会保留在当前设备中处理。

如何使用Git 速查表 - 常用命令快速参考

  1. 1在工具区域粘贴、输入或上传需要处理的内容。
  2. 2根据任务选择格式、尺寸、输出方式或校验选项。
  3. 3检查预览结果、提示信息或转换后的数据。
  4. 4确认结果无误后复制或下载,并用于后续工作。

Git 速查表 - 常用命令快速参考的常见使用场景

快速完成日常任务

无需安装桌面软件,打开网页即可处理常见的文本、图片、数据或格式转换任务。

检查与整理内容

在提交文件、发布内容或复制结果之前,快速发现格式问题并获得结构清晰的输出。

注重隐私的浏览器处理

对于支持本地运行的工具,数据会留在当前浏览器中,不需要上传到第三方服务。

常见问题

Git 速查表 - 常用命令快速参考可以解决什么问题?

免费在线 Git 速查表,按分类整理的可搜索命令参考。快速查找分支、合并、变基、暂存、重置等 Git 命令。

这个工具需要注册或付费吗?

不需要。你可以直接免费使用,不必创建账号。

工具会上传我的数据吗?

工具会尽可能在浏览器本地运行。需要后端服务的功能会在页面中明确标注。