git
差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
git [2020/11/20 23:00] – [压缩commit] plough | git [Unknown date] (当前版本) – 移除 - 外部编辑 (Unknown date) 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ===== cherry pick ===== | ||
- | [[https:// | ||
- | < | ||
- | # 单个提交 | ||
- | git cherry-pick < | ||
- | # 连续多个提交 | ||
- | git cherry-pick < | ||
- | </ | ||
- | ===== submodule ===== | ||
- | [[https:// | ||
- | * 数字列表项目子模块的配置文件:repo主目录下的 .gitmodules(不建议直接改这个文件) | ||
- | < | ||
- | # 创建一个子模块 | ||
- | git submodule add git@gitlab.xxx.com: | ||
- | # 创建一个子模块并指定分支和路径 | ||
- | git submodule add -b feature/ | ||
- | |||
- | # 更新子模块(子模块的内容切换为外部 repo 记录的 hash 号) | ||
- | git submodule update --init --recursive | ||
- | # 更新子模块(子模块的内容为对应分支上的最新提交) | ||
- | git submodule update --init --recursive --remote | ||
- | |||
- | # 列出所有子模块 | ||
- | git submodule | ||
- | </ | ||
- | |||
- | ===== 压缩commit ===== | ||
- | [[https:// | ||
- | < | ||
- | git rebase -i HEAD~4 | ||
- | </ | ||
- | |||
- | ===== 修改用户名和邮箱 ===== | ||
- | < | ||
- | // 设置全局 | ||
- | git config --global user.name " | ||
- | git config --global user.email " | ||
- | |||
- | // 或者设置本地项目库配置 | ||
- | git config user.name " | ||
- | git config user.email " | ||
- | |||
- | // 修改最近一次提交的用户信息 | ||
- | git commit --amend --author=" | ||
- | </ |
git.1605884441.txt.gz · 最后更改: 2022/12/28 17:53 (外部编辑)