English | 简体中文
Every Chinese law as a Markdown file. Every amendment as a Git commit.
Inspired by legalize-es (Spanish laws as Git, 954 stars).
Laws change. But understanding what changed is hard:
- Official gazettes publish the new version, not the diff
- Legal professionals spend hours comparing old vs new text
- Citizens can't easily track how laws evolve
Git solves this perfectly:
git log— see the full amendment history of any lawgit diff— see exactly what changed in each amendmentgit blame— trace when each article was added or modified- Pull Requests — propose and discuss legal interpretations
china-law-git/
├── 宪法相关/ # Constitutional laws
│ ├── 宪法.md
│ └── 立法法.md
├── 民商法/ # Civil & Commercial
│ ├── 民法典.md
│ └── 公司法.md
├── 刑法/ # Criminal
│ └── 刑法.md
├── 行政法/ # Administrative
│ └── 行政处罚法.md
├── 经济法/ # Economic
│ ├── 反垄断法.md
│ └── 消费者权益保护法.md
├── 社会法/ # Social
│ ├── 劳动法.md
│ └── 劳动合同法.md
├── 诉讼法/ # Procedural
│ └── 民事诉讼法.md
├── 新兴领域/ # Emerging (Tech/Data/AI)
│ ├── 个人信息保护法.md
│ ├── 数据安全法.md
│ └── 网络安全法.md
└── scripts/ # Automation tools
└── fetch_law.py # Fetch laws from official sources
# See the full history of a law
git log --oneline 新兴领域/个人信息保护法.md
# See what changed in the latest amendment
git diff HEAD~1 刑法/刑法.md
# Search all laws for a keyword
grep -r "人工智能" --include="*.md"
# Count articles across all laws
grep -c "^第.*条" **/*.mdThe Criminal Law (刑法) has been amended 12 times since 1997. In this repo, each amendment is a commit:
$ git log --oneline 刑法/刑法.md
a1b2c3d 刑法修正案(十二)(2024-12-25) — 加重行贿罪处罚
d4e5f6g 刑法修正案(十一)(2021-03-01) — 增设高空抛物罪等
g7h8i9j 刑法修正案(十)(2017-11-04) — 修改国歌条款
...
j0k1l2m 刑法 (1997-10-01) — 全面修订版
To see what 修正案十二 changed:
$ git diff d4e5f6g a1b2c3d 刑法/刑法.md
| Category | Laws | Status |
|---|---|---|
| Constitutional | 宪法, 立法法 | ✅ |
| Civil | 民法典, 公司法 | ✅ |
| Criminal | 刑法 | ✅ |
| Economic | 反垄断法, 消保法 | ✅ |
| Social | 劳动法, 劳动合同法 | ✅ |
| Tech/Data | 个保法, 数据安全法, 网安法 | ✅ |
| Procedural | 民诉法, 刑诉法 | Planned |
Chinese laws are government documents. Per Article 5 of the Copyright Law of the People's Republic of China (2020):
本法不适用于:(一)法律、法规,国家机关的决议、决定、命令和其他具有立法、行政、司法性质的文件,及其官方正式译文
Translation: Copyright protection does not apply to laws, regulations, resolutions, decisions, orders, and other documents of a legislative, administrative, or judicial nature.
- Found a typo? Submit a PR
- Have an older version of a law? Create a commit for that amendment
- Want to add local regulations? Create a
地方法规/directory
The law texts themselves are public domain (government documents). The repository structure and tooling are MIT licensed.