File tree 1 file changed +25
-1
lines changed
1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -520,6 +520,8 @@ git branch -D dev
520
520
521
521
那如果今天要刪除 remote 端的 branch 該怎麼辦呢:question :
522
522
523
+ * [ Youtube Tutorial - git 刪除查看遠端的分支 branch] ( https://youtu.be/0JQrT7nfm_c )
524
+
523
525
``` cmd
524
526
git push origin --delete {remote_branch}
525
527
```
@@ -598,6 +600,12 @@ git push -u origin v1
598
600
git branch -r
599
601
```
600
602
603
+ ``` cmd
604
+ git branch --remote
605
+ ```
606
+
607
+ ` --remote ` 或 ` -r ` 都可以.
608
+
601
609
假設遠端有一個名稱為 develop 的分支,
602
610
603
611
我們只要 checkout 到該分支底下就可以了
@@ -653,6 +661,22 @@ git -C git_folder pull
653
661
654
662
這樣是不是清楚多了!!!
655
663
664
+ 多補充一個參數 ` --prune ` ,
665
+
666
+ * [ Youtube Tutorial - git fetch 指令 prune 參數說明] ( https://youtu.be/ZMpMv1P1Q1Q )
667
+
668
+ 這個主要的功能是刪除 remote 無效的 branch,
669
+
670
+ 有時候明明已經把遠端的 branch 刪除, 但是你執行 ` git branch --remote ` ,
671
+
672
+ 卻會發現你還看的到那些 branch 的分支 (但明明網頁上的分支已經被移除了:sweat : )
673
+
674
+ 常常會發生在 pull 端(非工作端)的機器 (如果不懂這句話的意思建議看影片說明:smile : )
675
+
676
+ 這時候就可以同步一下本機和遠端的分支, 使用以下的指令
677
+
678
+ ` git fetch --prune `
679
+
656
680
## git rebase
657
681
658
682
什麼是 rebase 呢 ? git rebase 就是避免多餘 ( 沒有意義 ) 的 merge !!! 先看看下面兩張圖
@@ -960,7 +984,7 @@ git rebase -i f0a761d
960
984
961
985
![ alt tag] ( https://i.imgur.com/rgWkvVp.png )
962
986
963
- ( 如果你要合併多個,就多個都改成 s 或 squash )
987
+ ( 如果你要合併多個 commit ,就多個都改成 s 或 squash, 注意, 有順序性 : exclamation :: exclamation : )
964
988
965
989
將著按下 ENTER,會看到下圖
966
990
You can’t perform that action at this time.
0 commit comments