mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
Create git-switch.md (#7467)
This commit is contained in:
parent
1c448d3056
commit
1bcbdd1fa4
1 changed files with 29 additions and 0 deletions
29
pages.zh/common 公共的/git-switch.md
Normal file
29
pages.zh/common 公共的/git-switch.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# git switch
|
||||
|
||||
> 切换 Git 分支。要求 Git 版本在 2.23 以上。
|
||||
> 另请参阅 `git checkout`。
|
||||
> 更多信息:<https://git-scm.com/docs/git-switch>.
|
||||
|
||||
- 切换到一个已有的分支:
|
||||
|
||||
`git switch {{分支名字}}`
|
||||
|
||||
- 创建并切换到一个新分支:
|
||||
|
||||
`git switch --create {{分支名字}}`
|
||||
|
||||
- 创建并切换到基于某个提交的新分支:
|
||||
|
||||
`git switch --create {{分支名字}} {{指定提交}}`
|
||||
|
||||
- 切换到之前的分支:
|
||||
|
||||
`git switch -`
|
||||
|
||||
- 切换到一个分支,并更新所有匹配的子模块:
|
||||
|
||||
`git switch --recurse-submodules {{分支名字}}`
|
||||
|
||||
- 切换到一个分支,并和当前分支以及暂未提交的修改进行三方合并:
|
||||
|
||||
`git switch --merge {{分支名字}}`
|
Loading…
Add table
Reference in a new issue