. Advertisement .
..3..
. Advertisement .
..4..
I encounter “git error: failed to push some refs to” when I want to push on the code in git then established a private remote repository on git.
F:\game_project\node_project>git push -u origin master
To https://gitee.com/cn_xxxxx/node.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/cn_xxxxx/node.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
What can I do about the “git error: failed to push some refs to” ?
The cause: Changes not committed before pushing, issues with Git pre-push hook, incorrect branch name, or the local repository not being in sync with the Git repository are all common causes of error: failed to push some refs to.
The solution: First pull down automatically combined
after that, upload
The problem’s successful resolution.