git*: update outdated pages, fix English pages (#14149)

This commit is contained in:
Sebastiaan Speck
2024-10-13 10:26:47 +02:00
committed by GitHub
parent 896e024860
commit f21fa6a211
96 changed files with 302 additions and 302 deletions

View File

@@ -9,7 +9,7 @@
- 查看指定文件或指定目录的历史,包括每次提交所引入的差异:
`git log -p {{路径/到/文件或目录}}`
`git log {{-p|-u|--patch}} {{路径/到/文件或目录}}`
- 显示每次提交的文件修改统计信息:
@@ -25,12 +25,12 @@
- 查看提交消息中包含特定字符串(大小写敏感)的提交:
`git log -i --grep {{字符串}}`
`git log {{-i|--regexp-ignore-case}} --grep {{字符串}}`
- 查看特定作者的最近 N 条提交:
`git log -n {{数字}} --author={{作者}}`
`git log {{-n|--max-count}} {{数字}} --author "{{作者}}"`
- 查看两个日期之间的提交yyyy-mm-dd
`git log --before="{{2017-01-29}}" --after="{{2017-01-17}}"`
`git log --before "{{2017-01-29}}" --after "{{2017-01-17}}"`

View File

@@ -10,7 +10,7 @@
- 启动交互式的合并任务,允许对提交的内容进行重新排序、省略、合并或修改:
`git rebase -i {{目标分支或 commit 的 hash}}`
`git rebase {{-i|--interactive}} {{目标分支或 commit 的 hash}}`
- 处理完冲突文件后,继续执行合并任务:
@@ -30,8 +30,8 @@
- 启动交互式的合并任务,对最近提交的 5 个 commits 进行重新排序、省略、合并或修改:
`git rebase -i {{HEAD~5}}`
`git rebase {{-i|--interactive}} {{HEAD~5}}`
- 以当前分支优先的策略,自动处理分支间的冲突,执行合并:
`git rebase -X theirs {{分支名称}}`
`git rebase {{-X|--strategy-option}} theirs {{分支名称}}`

View File

@@ -5,7 +5,7 @@
- 列出已经存在的远程仓库,包括它们的名字和 URL
`git remote -v`
`git remote {{-v|--verbose}}`
- 查看某个远程仓库的信息:

View File

@@ -4,18 +4,6 @@
> 类似如 `commit`、`add`、`branch`、`checkout`、`push` 等子命令都有自己的使用文档,可以通过 `tldr git {{子命令}}` 的形式查阅。
> 更多信息:<https://git-scm.com/>.
- 检查 git 的版本号:
`git --version`
- 显示帮助文档:
`git --help`
- 显示 git 子命令的详细帮助文档(如 `clone`, `add`, `push`, `log` 等子命令):
`git help {{子命令}}`
- 执行 git 的子命令:
`git {{子命令}}`
@@ -27,3 +15,15 @@
- 在给定参数条件下,执行 git 的子命令:
`git -c '{{配置项}}={{值}}' {{子命令}}`
- 显示帮助文档:
`git --help`
- 显示 git 子命令的详细帮助文档(如 `clone`, `add`, `push`, `log` 等子命令):
`git help {{子命令}}`
- 检查 git 的版本号:
`git --version`