日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

git rebase -i 汇合提交

發布時間:2025/3/21 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 git rebase -i 汇合提交 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

教程3 改寫提交!

5. 用rebase -i 匯合提交

為了節省時間,這個教程使用現有的歷史記錄作為本地數據庫。

從這里下載

我們進入stepup-tutorial/tutorial5目錄。本地端的歷史記錄的狀態如下圖顯示。在這里匯合「添加commit的講解」和「添加pull的講解」的修改,然后合并到一個提交。

若要匯合過去的提交,請用rebase -i。

$ git rebase -i HEAD~~

打開文本編輯器,將看到從HEAD到HEAD~~的提交如下圖顯示。

pick 9a54fd4 添加commit的說明 pick 0d4a808 添加pull的說明# Rebase 326fc9f..0d4a808 onto d286baa # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # # If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove everything, the rebase will be aborted. #

將第二行的“pick”改成“squash”,然后保存并退出。由于合并后要提交,所以接著會顯示提交信息的編輯器,請編輯信息后保存并退出。

這樣,兩個提交就合并成一個提交了。請用log命令確認歷史記錄。


from:?http://backlogtool.com/git-guide/cn/stepup/stepup7_5.html

總結

以上是生活随笔為你收集整理的git rebase -i 汇合提交的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。