WZ.FYI

命令速查

开发者常用命令速查表,收录 Git、Linux、Docker、Vim、npm/yarn、SSH 六大分类 150+ 条命令,支持全局搜索与一键复制

Git(20) 点击卡片即可复制命令
git status

查看工作区状态

常用
git add .

添加所有变更到暂存区

常用
git commit -m "msg"

提交暂存区变更

常用
git push origin main

推送到远程 main 分支

常用
git pull

拉取并合并远程变更

常用
git checkout <branch>

切换分支

常用
git checkout -b <branch>

创建并切换到新分支

常用
git merge <branch>

合并指定分支到当前分支

常用
git log --oneline -10

查看最近 10 条提交

常用
git diff

查看未暂存的变更

常用
git stash

暂存当前工作区

常用
git stash pop

恢复暂存的工作区

常用
git init

初始化新仓库

基础
git clone <url>

克隆远程仓库

基础
git branch

列出本地分支

基础
git branch <name>

创建新分支

基础
git diff --staged

查看已暂存的变更

基础
git remote -v

查看远程仓库

基础
git tag v1.0

打标签

基础
git reset --hard HEAD

放弃所有本地变更(不可恢复)

危险