git remove commitに似た私の質問は、マージからコミットを削除しますが、リポジトリの履歴が少し異なるため、そこで提案されている指示に従うことはできません。
私はgithubのオープンソースリポジトリに取り組んでいます。数か月後、ローカルリポジトリを更新したかったのですが、誤って役に立たないマージコミットを行いました。履歴は次のようになります。
* commit 3d542ddb64e6474a10dfface24defc69b713a295
| Author: TD
|
| fixed typo in dependency_injection/compilation chapter
|
* commit 34db3b8c08e5c5d3be4021076716ed90187fe5fb
|\ Merge: b8b73fb 7cc08f4
| | Author: TD
| |
| | Merge remote-tracking branch 'upstream/master'
| |
| * commit 7cc08f476b7ac5610b1eb5b5db5182d18e35a9e9
| | Author: RW
| |
| | [#1654] Tweaking comments
...
私の小さな変更ではコミットは1つだけであるはずですが、2つあります。34db3b8c0...マージコミットを削除したいだけです。インタラクティブリベースを試す必要があることはわかっていますが、設定方法がわかりません。やってみると
git rebase -i HEAD~2
過去のコミットの膨大なリストを取得します。
pick bbfbddb Add the new "strict_requirements"
pick 31bb8a9 [reference] Tweaking note about strict_requirements
pick fb4d621 [Cookbook][Extension] Fixed typo in functions name
pick d8d1d86 Fixing index typo
# lots and lots of commits in the history here
pick c734436 Fixed indentation.
pick ca8d884 Update cookbook/logging/channels_handlers.rst
pick 7cc08f4 [#1654] Tweaking comments in channel handlers doc to point to reference
pick 3d542dd fixed typo in dependency_injection/compilation chapter: should be contAiner instead of continer
# Rebase b8b73fb..3d542dd onto b8b73fb
#
# Commands:
...
しかし、私が試してみると:
git rebase -i HEAD~1
(より短いリストが必要です)コミットは1つだけです:
pick 3d542dd fixed typo in dependency_injection/compilation chapter: should be contAiner instead of continer
私が理解している限り、インタラクティブなリベースを使用して、マージコミット34db3b8c08を押しつぶす必要がありますよね?
助けてくれてありがとう。