githubteacher / githubfordevelopers-april

GitHub for Developers Training
4 stars 11 forks source link

git push f() {sleep 1; echo "username=*** token=<**********>"; } f erase: 1: Syntax error: "}" unexpected #158

Open mianqi2016 opened 1 week ago

mianqi2016 commented 1 week ago

I used token for git push, it ran well before, and I checked the token, it was not expired. While, when I run "git push" in terminal, it was prompted: f() {sleep 1; echo "username=*** token=<*********>"; } f erase: 1: Syntax error: "}" unexpected Username for 'https://github.com': After I input the username and password(token), it was prompted: f() {sleep 1; echo "username=*** token=<*********>"; } f erase: 1: Syntax error: "}" unexpected remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/mianqi2016/MCS-51_asm.git/'

What's wrong?

mianqi2016 commented 1 week ago

I found the token in echo was different with the token I input, where to fix it?

mianqi2016 commented 1 week ago

Solution:

  1. Regenerated token
  2. git config --global --unset credential.helper
  3. git push