Clone is different from fork. I have also encountered it. Generally, to push, you must ensure that SSH is uploaded, and the project is forked to the account.
The reason why git push fails for the first time is because you did not specify upstream and branch.
Check out the git manual:
-u, --set-upstream
For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands. For more information, see branch.<name>.merge in git-config(1).
After using the -u parameter, there is no need to specify upstream for subsequent git push.
The problem has been solved, but I still don’t know the reason. .
The direct push using clone failed, but after adding it, git push -u origin master succeeded. . .
Check you, has your ssh-key been uploaded to csdn? ?
Clone is different from fork. I have also encountered it. Generally, to push, you must ensure that SSH is uploaded, and the project is forked to the account.
Look at the prompts and use https
The reason why git push fails for the first time is because you did not specify upstream and branch.
Check out the git manual:
After using the -u parameter, there is no need to specify upstream for subsequent git push.