mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
git-{checkout-index, cherry, cherry-pick}: add Chinese translation (#16098)
This commit is contained in:
parent
cc854b4551
commit
e21445163e
3 changed files with 57 additions and 0 deletions
20
pages.zh/common/git-checkout-index.md
Normal file
20
pages.zh/common/git-checkout-index.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# git checkout-index
|
||||
|
||||
> 将文件从暂存区复制到工作区。
|
||||
> 更多信息:<https://git-scm.com/docs/git-checkout-index>.
|
||||
|
||||
- 恢复自上次提交以来删除的所有文件:
|
||||
|
||||
`git checkout-index --all`
|
||||
|
||||
- 恢复自上次提交以来删除或修改的所有文件(强制覆盖):
|
||||
|
||||
`git checkout-index --all --force`
|
||||
|
||||
- 恢复自上次提交以来修改的文件(忽略已删除的文件):
|
||||
|
||||
`git checkout-index --all --force --no-create`
|
||||
|
||||
- 将最后一次提交的整个工作树导出到指定目录(注意结尾斜杠):
|
||||
|
||||
`git checkout-index --all --force --prefix={{路径/到/导出目录/}}`
|
21
pages.zh/common/git-cherry-pick.md
Normal file
21
pages.zh/common/git-cherry-pick.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# git cherry-pick
|
||||
|
||||
> 将现有提交的变更应用到当前分支。
|
||||
> 如需应用到其他分支,请先用 `git checkout` 切换到目标分支。
|
||||
> 更多信息:<https://git-scm.com/docs/git-cherry-pick>.
|
||||
|
||||
- 将单个提交应用到当前分支:
|
||||
|
||||
`git cherry-pick {{提交哈希}}`
|
||||
|
||||
- 将连续多个提交应用到当前分支(也可参考 `git rebase --onto`):
|
||||
|
||||
`git cherry-pick {{起始提交}}~..{{结束提交}}`
|
||||
|
||||
- 将多个(非连续的)提交应用到当前分支:
|
||||
|
||||
`git cherry-pick {{提交1 提交2 ...}}`
|
||||
|
||||
- 将提交变更应用到工作区但不自动创建提交:
|
||||
|
||||
`git cherry-pick --no-commit {{提交哈希}}`
|
16
pages.zh/common/git-cherry.md
Normal file
16
pages.zh/common/git-cherry.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# git cherry
|
||||
|
||||
> 查找尚未应用到上游分支的提交。
|
||||
> 更多信息:<https://git-scm.com/docs/git-cherry>.
|
||||
|
||||
- 显示已在上游分支有对应提交的提交(包含提交信息):
|
||||
|
||||
`git cherry {{[-v|--verbose]}}`
|
||||
|
||||
- 指定不同的上游分支和主题分支进行比较:
|
||||
|
||||
`git cherry {{上游分支}} {{主题分支}}`
|
||||
|
||||
- 限定比较范围到某个基准点之后的提交:
|
||||
|
||||
`git cherry {{上游分支}} {{主题分支}} {{基准点}}`
|
Loading…
Add table
Reference in a new issue