$ gh config set git_protocol https -h github.com
$ gh auth status --show-token # <== copy your authentication token
$ git credential reject <<<"url=https://github.com"
$ git credential approve <<<"url=https://USER:TOKEN@github.com"
source: cli/cli#1326