@@ -1484,7 +1484,7 @@ v2 分支中的 log 如下,我想要它的 553587b - add f.py這個 commit
1484
1484
1485
1485
假設我 commit history 為 A1 -> A2 -> A3 -> A4 -> A5 -> A6
1486
1486
1487
- 我現在想要回 A4 這個 commit , 這時候我就可以使用 git revert !!
1487
+ 我現在想要回 A4 這個 commit , 這時候我就可以使用 git revert !!
1488
1488
1489
1489
先 revert A6
1490
1490
@@ -1504,10 +1504,16 @@ A1 -> A2 -> A3 -> A4 -> A5 -> A6 -> A6_revert -> A5_revert
1504
1504
1505
1505
這時候,其實你的 commit 就是在 A4 這個位置 。
1506
1506
1507
- 使用 git revert 的好處,就是可以保留 commit history , 萬一你又後悔了,
1507
+ 使用 git revert 的好處,就是可以保留 commit history, 萬一你又後悔了,
1508
1508
1509
1509
也可以在 revert 回去。
1510
1510
1511
+ 如果你想要 revert 最新的 commit, 只需要使用 HEAD
1512
+
1513
+ ``` cmd
1514
+ git revert HEAD
1515
+ ```
1516
+
1511
1517
## 解決衝突
1512
1518
1513
1519
在進行合併的時候,有時候會顯示出 ** 衝突conflicts** ,這時候就必須手動解決衝突後再送出。
@@ -1936,6 +1942,10 @@ git config --global alias.br branch
1936
1942
git config --global alias.ck checkout
1937
1943
```
1938
1944
1945
+ ``` cmd
1946
+ git config --global alias.sw switch
1947
+ ```
1948
+
1939
1949
``` cmd
1940
1950
git config --global alias.cm commit
1941
1951
```
@@ -2108,7 +2118,7 @@ git remote set-url origin
[email protected] :blue-rubiks/t11.git
2108
2118
2109
2119
* [ Youtube Tutorial - github PR (Pull Request) 教學] ( https://youtu.be/bXOdD-bKfkA ) - [ 文章快速連結] ( https://github.com/twtrubiks/Git-Tutorials/tree/master/pr-tutorial#github-pr-pull-request-%E6%95%99%E5%AD%B8 )
2110
2120
2111
- * [ Youtube Tutorial - github CLI PR 教學] ( https://youtu.be/AD8X11lq3gQ ) - [ 文章快速連結] ( https://github.com/twtrubiks/Git-Tutorials/tree/master/pr-tutorial#github-cli-pr-%E6%95%99%E5%AD%B8 )
2121
+ * [ Youtube Tutorial - github CLI PR 教學 - gh ] ( https://youtu.be/AD8X11lq3gQ ) - [ 文章快速連結] ( https://github.com/twtrubiks/Git-Tutorials/tree/master/pr-tutorial#github-cli-pr-%E6%95%99%E5%AD%B8 )
2112
2122
2113
2123
[ PR (Pull Request) 教學] ( https://github.com/twtrubiks/Git-Tutorials/tree/master/pr-tutorial )
2114
2124
0 commit comments