branch
- 開発作業ブランチ
- feature/XXXX
- 開発環境ブランチ
- dev
- ステージング環境
- staging
- 本番環境
- production
※main(master)ブランチは初回コミット以降不使用
状況
- feature/XXXXブランチで開発完了したものをdevブランチにマージ済
- devブランチにマージした特定のコミットのみをstagingブランチにマージしたい。
- feature/XXXX→devのプルリクエストからコミットのIDをコピーし、stagingブランチにてcherry-pickを実行
- fatal: bad object (コミットID)エラーが出てしまい、マージできない
調べたこと
- 日本語記事があまり見られないが、fetchするという内容が多かった
試したこと
とにかく、リモートのブランチとローカルのブランチが等しくないことが原因と見て、
pullを実行
$ git pull warning: Pulling without specifying how to reconcile divergent branches is discouraged. You can squelch this message by running one of the following commands sometime before your next pull: git config pull.rebase false # merge (the default strategy) git config pull.rebase true # rebase git config pull.ff only # fast-forward only You can replace "git config" with "git config --global" to set a default preference for all repositories. You can also pass --rebase, --no-rebase, or --ff-only on the command line to override the configured default per invocation. Already up to date.
その後再度cherry-pickを実行するも解決せず。
$ git cherry-pick XXXXX fatal: bad object XXXXX
回答1件
あなたの回答
tips
プレビュー