-
Notifications
You must be signed in to change notification settings - Fork 0
lisinan88/ecr-tf
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
git checkout 命令用于在不同的分支之间切换、恢复文件、创建新分支等操作。 注意:git checkout 命令在 Git 2.23 版本后引入了 git switch 和 git restore 命令,分别用于分支切换和文件恢复,以提供更清晰的语义和错误检查。如果你使用较新的 Git 版本,可以考虑使用这些命令代替 git checkout。 切换分支: 以下命令允许你从当前分支切换到指定的分支 <branch-name>: git checkout <branch-name> 例如将你的工作目录切换到主分支: git checkout master 创建新分支并切换: 以下命令用于创建一个新分支 <new-branch-name> 并立即切换到新创建的分支: git checkout -b <new-branch-name> 例如创建一个名为 feature-branch 的新分支并切换到它: git checkout -b feature-branch 切换到前一个分支: 以下命令可以让你快速切换回前一个分支,无需记住分支名称: git checkout - 检出文件: 以下命令可以将工作区指定文件 <file> 恢复到最近一次提交时的状态,丢弃所有未提交的更改,这对于撤销不需要的更改非常有用: git checkout -- <file> 具体来说,这个命令会撤销对文件的所有未提交更改,将文件恢复到当前分支的 HEAD(最新提交)所记录的状态。 切换到特定提交: 你可以使用提交的哈希值 <commit-hash> 来切换到特定的提交状态。这将使你进入"分离头指针"状态,只能查看历史记录,而不能进行分支操作。通常情况下,不建议在分离头指针状态下工作,因为更改可能会丢失。 git checkout <commit-hash> 切换到标签: 如果你有一个标签 <tag-name>,你可以使用这个命令来切换到该标签所指向的提交状态。 git checkout tags/<tag-name> vscode快捷键 # alt + shift + a 代码块注释 # alt + shift + i 代码块取消注释 # alt + shift + p 打开命令面板 # alt + shift + f 格式化代码 # alt + shift + j 代码块合并 # alt + shift + k 代码块拆分 # alt + shift + up 代码块上移 # alt + shift + down 代码块下移 # alt + shift + left 代码块左移 # alt + shift + right 代码块右移 # alt + shift + c 复制当前行到下一行 # alt + shift + v 粘贴到当前行 # alt + shift + x 剪切当前行 # alt + shift + z 撤销 # alt + shift + y 重做 # alt + shift + w 关闭当前文件 # alt + shift + e 打开文件资源管理器 # alt + shift + o 打开文件 # alt + shift + s 保存文件 # alt + shift + f 格式化代码 # alt + shift + p 打开命令面板 # control tab 代码右移动一行 # shift + tab 代码左移动一行 # ctrl + / 单行注释
About
MSP_POC_Fee
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published