Using token kinda troublesome and although we know we can manually drag and drop files on GitHub repo when faced worst situation...
GitHub rate_limit always showing 0/60 without doing nothing or even Token on website has been deleted (even worse) when :~$ sudo su - -c "R -e \"devtools::update_packages()\"", try to refer to below links.
# start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
> Agent pid 59566
$ ssh-add
> Enter passphrase for /home/you/.ssh/id_rsa: [tippy tap]
> Identity added: /home/you/.ssh/id_rsa (/home/you/.ssh/id_rsa)
Above codes working fine without error but GitHub git push still ask for token.
+(base) :~/Documents/GitHub/CG.IwithR$ git init
Reinitialized existing Git repository in /home/englianhu/Documents/GitHub/CG.IwithR/.git/
+(base) :~/Documents/GitHub/CG.IwithR$ git fetch
+(base) :~/Documents/GitHub/CG.IwithR$ git add -A && git commit -m "update" && git fetch
[master 3b5844a] update
1 file changed, 1 insertion(+), 1 deletion(-)
+(base) :~/Documents/GitHub/CG.IwithR$ git push
-error: unable to read askpass response from 'rpostback-askpass'
-fatal: could not read Username for 'https://github.com': terminal prompts disabled
+(base) :~/Documents/GitHub/CG.IwithR$ ssh -T git@github.com
Hi englianhu! You've successfully authenticated, but GitHub does not provide shell access.
+(base) :~/Documents/GitHub/CG.IwithR$ eval "$(ssh-agent -s)"
Agent pid 237003
+(base) :~/Documents/GitHub/CG.IwithR$ ssh-add
Identity added: /home/englianhu/.ssh/id_rsa (englianhu@gmail.com)
Identity added: /home/englianhu/.ssh/id_ed25519 (englianhu@gmail.com)
+(base) :~/Documents/GitHub/CG.IwithR$ git push
-error: unable to read askpass response from 'rpostback-askpass'
-fatal: could not read Username for 'https://github.com': terminal prompts disabled
+(base) :~/Documents/GitHub/CG.IwithR$ git push
-remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
-remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
-fatal: Authentication failed for 'https://github.com/englianhu/CG.IwithR.git/'
I know this is not a general help forum, but just to share my piece when dealing with this issue: I had to switch from https to ssh url. This resolved the issue.