docs: 更新个人常用Git命令、快捷键

This commit is contained in:
2023-12-14 19:59:55 +08:00
parent 48eb24c674
commit 3ef8b6e224
2 changed files with 14 additions and 3 deletions

View File

@@ -126,7 +126,9 @@ git reset --soft HEAD~回退版本的数量/HEAD^/Commit ID
:::
```shell
git commit --amend [--author="用户名 <用户邮箱>"] [-m 提交信息]
# 如果仅修改用户名这类信息,改完在编辑模式按 : 随后按 wq 保存即可
# 信息格式参考 git log 输出
git commit --amend [--author="用户名<用户邮箱>"] [--date "日期信息"] [-m 提交信息]
```
### 修改指定提交的信息
@@ -144,7 +146,8 @@ git commit --amend [--author="用户名 <用户邮箱>"] [-m 提交信息]
git rebase -i Commit ID
# 2.打开记事本后,将对应提交前的 pick 改为 e 或 edit保存退出
# 3.进行修订,同上
git commit --amend [--author="用户名 <用户邮箱>"] [-m 提交信息]
# 信息格式参考 git log 输出
git commit --amend [--author="用户名<用户邮箱>"] [--date "日期信息"] [-m 提交信息]
# 4.完成
git rebase --continue
```
@@ -214,7 +217,7 @@ git clone 远程仓库Git地址
git pull [远程主机名] [远程分支名]:[本地分支名]
```
## 多人协作
## 分支相关
### 查看本地分支
@@ -246,6 +249,12 @@ git switch 分支名
git merge 分支名
```
### 重命名分支
```shell
git branch -m old-branch new-branch
```
## 标签相关
### 查看标签

View File

@@ -76,6 +76,7 @@ tags:
- Shift + 回车:在下方插入一行,光标移动到新行行首
- Ctrl + /:给光标所在行 或 选中行代码 添加或取消单行注释(可根据当前的文件类型,使用不同的注释符号)
- Ctrl + Shift + /:以 `多行注释` 注释掉选中行
- Ctrl + Shift + U切换单词大小写
- Ctrl + Alt + T给选中代码块添加语句块try-catch、while等
- Alt + 回车:提供快速修复选择
- Alt + Shift + 上/下键:向上或向下移动当前行/选中行
@@ -91,6 +92,7 @@ tags:
- Ctrl + Alt + 鼠标左键在某个使用的方法上点击可直接定位到该方法在对应子类重写的位置在Controller中想看看调用Service层怎么实现的
- [Fn] + Ctrl + End跳转到文件尾部
- [Fn] + Ctrl + Home跳转到文件头部
- Ctrl + G跳转到指定行:列
- Ctrl + Q显示光标所在的类名、方法名、变量名的 java doc 注释
- Ctrl + Alt + O优化 import 语句,自动导入包或移除无用包
- [Fn] + Shift + F9调试按钮