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
```
## 标签相关
### 查看标签