2021-02-27 15:01:45 +00:00
|
|
|
|
# 原创
|
|
|
|
|
: 02-图解Git笔记
|
|
|
|
|
|
|
|
|
|
# 02-图解Git笔记
|
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
## 图解Git笔记
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
参考:[图解 Git](http://marklodato.github.io/visual-git-guide/index-zh-cn.html)
|
|
|
|
|
|
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
### 基本用法
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
### 命令详解
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
#### Diff
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
git diff maint(分支名)
|
|
|
|
|
git diff b325c da985
|
|
|
|
|
git diff --cached
|
|
|
|
|
git diff
|
|
|
|
|
git diff HEAD
|
|
|
|
|
```
|
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
#### Commit
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
|
|
|
|
或者
|
|
|
|
|
|
|
|
|
|
如果想**更改一次提交**,使用 `git commit --amend`。git会使用与当前提交相同的父节点进行一次新提交,旧的提交会被取消。
|
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
#### Checkout
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
#### Reset
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
#### Merge
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
#### Cherry Pick
|
2021-02-27 15:01:45 +00:00
|
|
|
|
|
2024-07-03 09:49:47 +00:00
|
|
|
|
#### Rebase
|