Skip to content

Commit e214451

Browse files
authored
git-{checkout-index, cherry, cherry-pick}: add Chinese translation (#16098)
1 parent cc854b4 commit e214451

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

Diff for: pages.zh/common/git-checkout-index.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# git checkout-index
2+
3+
> 将文件从暂存区复制到工作区。
4+
> 更多信息:<https://git-scm.com/docs/git-checkout-index>.
5+
6+
- 恢复自上次提交以来删除的所有文件:
7+
8+
`git checkout-index --all`
9+
10+
- 恢复自上次提交以来删除或修改的所有文件(强制覆盖):
11+
12+
`git checkout-index --all --force`
13+
14+
- 恢复自上次提交以来修改的文件(忽略已删除的文件):
15+
16+
`git checkout-index --all --force --no-create`
17+
18+
- 将最后一次提交的整个工作树导出到指定目录(注意结尾斜杠):
19+
20+
`git checkout-index --all --force --prefix={{路径/到/导出目录/}}`

Diff for: pages.zh/common/git-cherry-pick.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# git cherry-pick
2+
3+
> 将现有提交的变更应用到当前分支。
4+
> 如需应用到其他分支,请先用 `git checkout` 切换到目标分支。
5+
> 更多信息:<https://git-scm.com/docs/git-cherry-pick>.
6+
7+
- 将单个提交应用到当前分支:
8+
9+
`git cherry-pick {{提交哈希}}`
10+
11+
- 将连续多个提交应用到当前分支(也可参考 `git rebase --onto`):
12+
13+
`git cherry-pick {{起始提交}}~..{{结束提交}}`
14+
15+
- 将多个(非连续的)提交应用到当前分支:
16+
17+
`git cherry-pick {{提交1 提交2 ...}}`
18+
19+
- 将提交变更应用到工作区但不自动创建提交:
20+
21+
`git cherry-pick --no-commit {{提交哈希}}`

Diff for: pages.zh/common/git-cherry.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# git cherry
2+
3+
> 查找尚未应用到上游分支的提交。
4+
> 更多信息:<https://git-scm.com/docs/git-cherry>.
5+
6+
- 显示已在上游分支有对应提交的提交(包含提交信息):
7+
8+
`git cherry {{[-v|--verbose]}}`
9+
10+
- 指定不同的上游分支和主题分支进行比较:
11+
12+
`git cherry {{上游分支}} {{主题分支}}`
13+
14+
- 限定比较范围到某个基准点之后的提交:
15+
16+
`git cherry {{上游分支}} {{主题分支}} {{基准点}}`

0 commit comments

Comments
 (0)