Reconcile divergent branches error git:
I got stuck in a situation where, my colleague, merged 2 branches and when I tried to pull the code from that particular branch, I started getting this error.
fatal: Need to specify how to reconcile divergent branches.
Here is the full error described.
user@vPro:/var/www/html/laravel$ git pull origin newsletter From https://github.com/xxxx-group/xxxxxx-laravel * branch newsletter -> FETCH_HEAD 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 (the default strategy) 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.
Solution:
user@vPro:/var/www/html/laravel$ git config pull.rebase true
Now try to pull again:
user@vPro:/var/www/html/laravel$ git push origin newsletter Enumerating objects: 11, done. Counting objects: 100% (11/11), done. Delta compression using up to 4 threads Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 1.29 KiB | 1.29 MiB/s, done. Total 6 (delta 5), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (5/5), completed with 5 local objects. To https://github.com/xxxx-group/xxxxxx-laravel.git eef1xxx..xxx9917 newsletter -> newsletter
It will work fine.
Now try to pull the code again.
user@vPro:/var/www/html/laravel$ git pull origin newsletter From https://github.com/xxxx-group/xxxxxx-laravel * branch newsletter -> FETCH_HEAD Already up to date.
You can get more details about this topic fromĀ here.
To check more articles related to this topic, please check related postsĀ here.
Please follow and like us: