看板 Soft_Job 關於我們 聯絡資訊
請教一下 有個branch的名稱叫做cat cat上有五次commit的紀錄 現在要將cat分支合併到master分支上 希望合併後在版本控制工具上不要顯示cat的各個commit 好讓commit的graph顯得簡單明白 有哪些命令或步驟可以達成? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.46.131.206 ※ 文章網址: https://www.ptt.cc/bbs/Soft_Job/M.1541582998.A.C6D.html
cha122977: git branch -D 或 git prune? 11/07 17:35
mintu: 可以 merge 後,rebase 來 squash commit,Github or Bit 11/07 17:36
mintu: bucket 也能對 mergr 選擇不同的 strategy 11/07 17:36
leolarrel: git merge --squash 11/07 17:36
mintu: 少了一個 s,commits XD 11/07 17:37
mintu: 4F 的應該更簡潔耶! 11/07 17:38
jackylu63: git log --first-parent 11/07 18:28
abc0922001: 直接 --squash就好了,不過我反而喜歡留commit內容 11/07 19:22
dalconan: 用cherry-pick把cat的commit都撿進來然後砍掉cat(X 11/07 21:43
zelda123: source branch 做好 rebase 再 merge 就好 11/07 22:27
GGFACE: git rebase -i 11/08 11:27
xji4m3: 我們merge strategy 是用預設的,pr review 完後會軟性要 11/08 23:46
xji4m3: 求用rebase -i將commits合併留下重要的後再merge 沒有硬性 11/08 23:46
xji4m3: 規定就是了 11/08 23:46
Hannibal8856: rebase -i 11/10 21:56
shietsd: rebase -i 明明就只是不會顯示分支插進來的線 11/10 22:14
shietsd: 而是像原本就在master上開發一樣的結果, commit 還是會在 11/10 22:15
shietsd: 讓 commit graph 比較好看而已吧 11/10 22:16