Skip to content

About

🇨🇳⚖️ 中国法律的Git仓库 - 每部法律一个Markdown,每次修法一次commit。Chinese laws as Git.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

china-law-git 🇨🇳⚖️

English | 简体中文

Every Chinese law as a Markdown file. Every amendment as a Git commit.

Inspired by legalize-es (Spanish laws as Git, 954 stars).

Why Git for Laws?

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 law
  • git diff — see exactly what changed in each amendment
  • git blame — trace when each article was added or modified
  • Pull Requests — propose and discuss legal interpretations

Structure

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

Quick Start

# 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 "^第.*条" **/*.md

Example: Criminal Law Amendments

The 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

Coverage

Category Laws Status
Constitutional 宪法, 立法法 ✅
Civil 民法典, 公司法 ✅
Criminal 刑法 ✅
Economic 反垄断法, 消保法 ✅
Social 劳动法, 劳动合同法 ✅
Tech/Data 个保法, 数据安全法, 网安法 ✅
Procedural 民诉法, 刑诉法 Planned

Legal Basis

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.

Contributing

  • 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

License

The law texts themselves are public domain (government documents). The repository structure and tooling are MIT licensed.

About

🇨🇳⚖️ 中国法律的Git仓库 - 每部法律一个Markdown,每次修法一次commit。Chinese laws as Git.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages