本文最后更新于 495 天前,其中的信息可能已经有所发展或是发生改变。
2024/11/4
名称
git add – 添加文件内容到索引
实例
git add .
git commit – 记录仓库的修改
–amend 撤回最新提交的备注内容重新输入
git commit -m "备注内容"
git commit --amend
git log – 显示提交日志
查看当前最新版本和之前的区别
git log --stat
git reflog – 管理重引用日志信息
该命令管理记录在引用日志中的信息。
git reflog [show] [<log-options>] [<ref>]
git reflog list
git reflog expire [--expire=<time>] [--expire-unreachable=<time>]
[--rewrite] [--updateref] [--stale-fix]
[--dry-run | -n] [--verbose] [--all [--single-worktree] | <refs>…]
git reflog delete [--rewrite] [--updateref]
[--dry-run | -n] [--verbose] <ref>@{<specifier>}…
git reflog exists <ref>
git diff – 显示提交和工作区等变化
git diff example1 example2 --stat
代理
git config --global http.proxy http://proxy.example.com:8080
git config --global --unset http.proxy
feat: 新功能(feature)
fix: 修补bug
docs: 文档(documentation)
style: 格式(不影响代码运行的变动)
refactor: 重构(即不是新增功能,也不是修改bug的代码变动)
chore: 构建过程或辅助工具的变动
revert: 撤销,版本回退
perf: 性能优化
test:测试
improvement: 改进
build: 打包
ci: 持续集成