Skip to Main Content
Git 常用 命令 集合Back to Top

Git 常用 命令 集合

放弃 本地 某文件修改

 gst                                                                                                                                                                         ─╯
 m themes/ametrine
 M zola.toml
git submodule update --init --recursive --checkout --force themes/ametrine

作用: 这行命令会强制(–force)将 themes/ametrine 子模块恢复到当前主项目 master 分支所记录的那个精确的 Commit 节点,直接抹去本地所有未提交的修改

cd themes/ametrine
git reset --hard HEAD
git clean -fd

操作后,

 git status                                                                                                                                                                  ─╯
Found existing alias for "git status". You should use: "gst"
Found existing git alias for "status". You should use: "git st"
 M zola.toml