Local Git can clone GitHub projects but cannot pull and push

Weird problem, finally solved

background

Whether it is sourcee, idea or vscode, after linking to the github repository, you can only clone, but not pull and push

After checking various statements on the Internet, it is all about adding auth and various configurations. But none of them solved my problem.
Got it today.

Analysis process

# 输入如下命令查看 git 
brew search git

Found an error, as shown in the figure:
insert image description here

solve

1. Create a personal token on GitHub, as shown in the figure

insert image description here

2. Then paste your own token and execute the following command

echo 'export HOMEBREW_GITHUB_API_TOKEN=这里替换github上的 token' >> ~/.zshrc

Supplement: My computer is macOS M1, other devices are similar

Guess you like

Origin blog.csdn.net/u012723183/article/details/130599242