Locally associated with the github remote repository, and an error is reported locally when pulling or pushing:
error: src refspec master does not match any error: failed to push some refs to 'github.com:Lydever/typescript-projects.git'
reason
The inconsistency between the local branch and the remote branch is caused. Starting from 2020, the default branch of the warehouse created on github is main
no longer master
, and the default branch after the local git is initialized ismaster
solve
Rename the branch to make the branch name consistent: rename
tomaster
main
git branch -m oldBranchName newBranchName
At this time, pull
or push
will not report an error.