Git error:
$ git push -u origin master
To [email protected]:***.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:***.git
hint: Updates were rejected because the tip of your current branch is behin
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Git already has some code in the repository, so it doesn’t allow you to overwrite your code directly. There are two ways to solve this problem:
method 1: force the code to github warehouse (recommended, save time and effort)
git push -f origin master //直接强推,即利用强覆盖方式用你本地的代码替代github仓库内的内容
method 2: fetch git’s stuff to your local, merge and push
git fetch
git merge //这两条命令等价于git pull
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
Then pull git back and git pushes your code. Reference: Here.
Read More:
- [Git & GitHub] Solution: error: failed to push some refs to’https://github.com/xxxx.git’
- error: src refspec master does not match any error:failed to push some refs to ‘[email protected]:xxxx
- Git failed to submit data error: failed to push some refs to’https://github.com/XXXXXXX/gif.git’
- error: src refspec master does not match anyerror: failed to push some refs to
- Solve github :error: failed to push some refs to problem
- Push failed Unable to access ‘https://github.com/‘: Failed to connect to github.com port 443: Timed
- Error: SRC refspec master does not match any. error: failed to push some refs to
- GitHub upload failed: git push error: failed to push some refs to exception handling
- How to solve error: failed to push some refs to ‘[email protected]:……git pull conflict
- git push error failed to push some refs to solution
- Error: failed to push some refs to ‘xxx’
- Error report after solving git push origin master
- fatal: unable to access ‘https://github.com/xxx‘: Failed to connect to github.com
- Failed to push some refs to
- Git clone appears fatal: unable to access’ https://github.com/… The solution to the problem
- pathspec ‘master’ did not match any files known to git
- After the two hosts set up the master-slave replication of MySQL, the show slave status displays: last_ IO_ Error: error connecting to master ……
- unable to access ‘https://github.com/facebook/react-devtools/‘:
- Gitpod cannot push to GitHub solution