我参与了一些本地提交,从远程其他人做了一些提交到我的本地分支,然后做了一些本地提交。我希望我做到了一个。
问题是当我git -log
列出时:
commit 1b6f7af1bdf21f397bab146fca11f74151b30e15(HEAD - > bug_fixing, origin / bug_fixing)作者:史蒂夫日期:周三1月 17 18:23:17 2018 -0500
fix issued Play #30, #27, #26; GPL #240
commit 069646ced4300bb30d6fbe33fbebb8e504e55de6合并:c215cbc3 23cf454b作者:史蒂夫日期:1月17日星期三 2018年 - 18月18日18:17:10
downloadThread to Executor
commit c215cbc3751092b00573152db2ced2369672497a作者:steve 日期:1月17日星期三18:10:56 2018 -0500
downloadThread to Executor
commit 4dffc55b667580b3103b6c5f1d9f17ad1d95c134作者:steve 日期:1月17日星期三18:10:42 2018 -0500
downloadThread to Executor
commit 23cf454b4bf82fe9808259ac7cc76643d45869f8(origin / play, origin / HEAD)作者:geecko日期:1月14日星期日 01:05:57 2018 +0100
Show ID3 lyrics in floating window only if no connectivity
我想把前四个提交压缩成一个。但是,当我git rebase -i HEAD~4
时,我在编辑器中得到以下内容:
pick 4dffc55b downloadThread to Executor
pick c215cbc3 downloadThread to Executor
pick 60c385c6 Change error message when requesting lyrics while missing both fingerprint and artist/title. Also refresh lyrics after being granted storage permission
pick ded8bea7 Add User Poll
pick 04e9484c Don't use appsee if user has had the app for more than a day
pick 37468ce2 Auto cancel the translation & survey notifications
pick ead6b151 Remove useless conditions
pick 7988b0b5 Add test device (AdMob)
pick 70da81e0 Fix NPE in OverlayContentLayout
pick 15f05ce1 Refresh MediaStore every once in a while
pick 923d63e9 Bump versionCode
pick 635543d9 Show resync button for API versions < Kitkat
pick 9b8de33a Retain user input inside UserPollActivity after rotation
pick 23cf454b Show ID3 lyrics in floating window only if no connectivity
pick 1b6f7af1 fix issued Play #30, #27, #26; GPL #240
其中包括从远程提取的提交,我不知道该怎么做。我如何压缩日志中列出的前四个提交?
答案 0 :(得分:0)
通常情况下,如果您只想压缩日志中列出的前四个提交,则必须执行以下操作:
git reset --soft HEAD~4
和git commit -m "new message"