Avatar
🎯

Organizations

1 results for
  • 这篇博客用来记录平时用到的一些 Git 操作,用到之后会不定时更新。 clone 相关 克隆指定 branch : git clone --branch <branch-name> <remote-repo-url> 递归克隆(包括 submodule ):git clone --recursive 已经 clone 完的仓库:git submodule update --init --recursive checkout 相关 切换分支:git checkout <branch-name> / git switch <branch-name> 新建分支:git checkout -b <branch-name> / git switch -c <branch-name> 切换到一个 tag :git fetch --all --tags --prune -> git tag -> 使用 / 快速搜索 -> git checkout tags/<tag-name> -b <branch-name> commit 相关 undo 本地改动(还未 commit):git restore <file-path>
    git Created Tue, 23 Jan 2024 09:50:29 +0800