Open1

GitHub の fatal: Need to specify how to reconcile divergent branches エラーの解決方法

まさぴょんまさぴょん

fatal: Need to specify how to reconcile divergent branches エラーの解決方法

https://zenn.dev/azunasu/articles/92859cb37cbd96

エラー内容

git pull origin master

remote: Enumerating objects: 33, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 26 (delta 10), reused 23 (delta 9), pack-reused 0
Unpacking objects: 100% (26/26), 789.64 KiB | 1.02 MiB/s, done.
From github.com:yukimura-manase/giftech2024s-team-e
 * branch            master     -> FETCH_HEAD
   74463b3..e206af1  master     -> origin/master
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint: 
hint:   git config pull.rebase false  # merge
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.

hint にある通り、3つのどれかを設定すれば、上記Errorは発生しなくなる

hint:   git config pull.rebase false  # merge
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
  1. Merge
  2. Rebase
  3. Fast-Foward Only

Merge 設定を選択

git config pull.rebase false 

再度、git pull origin master で pullができることを確認しました🌟

参考・引用

https://zenn.dev/azunasu/articles/92859cb37cbd96

https://smv.hatenablog.com/entry/2023/11/03/185638

https://qiita.com/aogangcun/items/9d43c7b1aa6b616f9ce8

https://www.cyberithub.com/solved-fatal-need-to-specify-how-to-reconcile-divergent-branches/

https://qiita.com/akiyama5433/items/5fcd23f4301ec8674d54