> For the complete documentation index, see [llms.txt](https://tobyisme.gitbook.io/gitlab/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tobyisme.gitbook.io/gitlab/learn-git/di-qi-tang-ke-fu-hao.md).

# 第七堂課 -  "\~" 符號

## "\~" 符號

假設需要在 commit tree 中向上移動多個 commit。使用太多`^`會非常討人厭，所以 Git 也加入了波浪（\~）符號。

波浪符號後面可以選擇一個數字（你也可以不選擇），該數字可以告訴 Git 我要向上移動多少個 commit 。舉個例子

## 破關提示：

## Branch forcing

你現在是相對引用的高手了，現在用它來實際做點事情。

我使用相對引用最多的就是移動分支。你可以使用`-f`選項直接讓分支指向另一個 commit。舉個例子:

`git branch -f master HEAD~3`

（強制）移動 master 指向從 HEAD 往上數的第三個 parent commit。

## 語法如下：

```
git branch -f master C6
git branch -f bugFix C0
git checkout C1
```
