Bench update only updating frappe, not erpnext

on a production site, where I am struggling to update to latest bench, and migrating to python 3.8 following this guide and failing a lot of stuff, then after running bench migrate-env /usr/bin/python3.8 I can run bench commands again on bench 5.8.0, when I run bench update, it only update frappe

frappe@localhost:~/frappe-bench$ bench update --patch
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
 * branch                  version-13 -> FETCH_HEAD
Backing up sites...

when I update pip install -U frappe-bench and get bench 5.11.0 I cannot run bench command, therefore I downgrade it to 5.10.0 > 5.9.0 > and finally on 5.8.0 I can run bench command again.

Currently installed apps are:
frappe@localhost:~/frappe-bench$ bench version
erpnext 13.34.1
frappe 13.33.1
frappe@localhost:~/frappe-bench$ bench --version
INFO: A newer version of bench is available: 5.8.0 → 5.11.0

additional info: I cannot run bench switch-to-branch version-13 to move away from develop branch and receiving this error.

frappe@localhost:~/frappe-bench$ bench switch-to-branch version-13
ERROR: cannot import name 'string_types'
Traceback (most recent call last):
  File "/home/frappe/.local/bin/bench", line 8, in <module>
  File "/home/frappe/.local/lib/python3.6/site-packages/bench/", line 121, in cli
    raise e
  File "/home/frappe/.local/lib/python3.6/site-packages/bench/", line 111, in cli
  File "/home/frappe/.local/lib/python3.6/site-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/.local/lib/python3.6/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/.local/lib/python3.6/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/.local/lib/python3.6/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/.local/lib/python3.6/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.local/lib/python3.6/site-packages/bench/commands/", line 41, in switch_to_branch
    switch_to_branch(branch=branch, apps=list(apps), upgrade=upgrade)
  File "/home/frappe/.local/lib/python3.6/site-packages/bench/utils/", line 102, in switch_to_branch
    switch_branch(branch, apps=apps, bench_path=bench_path, upgrade=upgrade)
  File "/home/frappe/.local/lib/python3.6/site-packages/bench/utils/", line 32, in switch_branch
    import git
  File "/home/frappe/.local/lib/python3.6/site-packages/git/", line 38, in <module>
    from git.exc import *                       # @NoMove @IgnorePep8
  File "/home/frappe/.local/lib/python3.6/site-packages/git/", line 9, in <module>
    from git.compat import UnicodeMixin, safe_decode, string_types
  File "/home/frappe/.local/lib/python3.6/site-packages/git/", line 21, in <module>
    from gitdb.utils.encoding import (
ImportError: cannot import name 'string_types'

Now I am lost. I don’t know which python version is used by bench, cannot update to latest version of bench, and bench seems not detecting ERPNext.

Currently, ERPNext is still running, and users can use it, but I’m afraid things might break unexpectedly in this state.

@Tej , this has been resolved by the below command. hope this may help others.

su - frappe
cd ~/frappe-bench/
source env/bin/activate
pip3 uninstall gitdb2 #updated
pip3 install --upgrade gitdb2==2.0.6 gitdb==0.6.4