--- title: "Git" type: concept tags: [Git, VCS, 版本控制, DevOps] sources: [ctp-topic-2-git.md] last_updated: 2026-04-19 --- ## Definition Git(分布式版本控制系统)是一种开源的分布式版本控制系统,用于跟踪代码变更、支持多人协作开发。每个开发人员都拥有完整的代码仓库副本,支持离线工作、分支合并和历史追溯。 ## Core Features - 分布式架构:每个用户拥有完整仓库副本 - 分支管理:支持轻量级分支和快速合并 - 完整性保证:使用 SHA-1 哈希确保数据完整性 - 性能:本地操作极快,网络操作按需拉取 ## Common Commands - `git clone`:克隆远程仓库 - `git add` / `git commit`:暂存和提交更改 - `git push` / `git pull`:推送和拉取远程更改 - `git branch` / `git checkout`:分支管理 - `git merge` / `git rebase`:合并分支 ## Related Concepts - [[Infrastructure as Code (IaC)]] - [[CI/CD 流水线]] - [[GitOps]] ## Related Entities - [[GitHub]] - [[GitLab]] - [[Gitea]] ## Aliases - Git - Git 版本控制 - 分布式版本控制