Today, a new project was created locally and a warehouse was built on the code cloud. You want to push it to the code cloud locally, but git push - U origin master
, an error is reported:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/xxx/app.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.
After searching, use: git pull -- rebase origin master
to solve the difference between
rebase and merge:
rebase puts the commit from your current branch at the end of the public branch, so it's called a rebase.
merge merges the public branch with your current commit to form a new commit
Read More:
- Git Push Error: failed to push some refs to ‘[email protected]:
- Git Push Error: error: failed to push some refs… hint: Updates were rejected because the remote…
- Local repository upload to remote repository error: failed to push some refs to ‘https://hub.fastgit.org/zhizhangxuezhang/ui-test.git‘
- How to Solve Git Error: error: failed to push some refs to……
- [Solved] error: failed to push some refs to ‘https://gitee.com/wangdxstudy/mygirl.git‘
- [Solved] Git Common Error: error: src refspec xxx does not match any/error: failed to push some refs to
- Git push Submit to Remote Error: “remote: Support for password authentication was removed on August 13, 2021.“
- Git Push remote error: GH007: Your push would publish a private email address.
- [Solved] Git Push Error: &fatal: the remote end hung up unexpectedly
- Git push Failed to connect to localhost port 1080 [How to Solve]
- [Solved] Git error: refname refs/heads/master not found
- [Solved] Git push Error: remote: Support for password authentication was removed on August 13, 2021.
- hint: Updates were rejected because the remote contains work that you do To XXX
- Git pull and Git pull origin master Warning: Pulling without specifying how to reconcile divergent branches
- Git fatal: No configured push destination. Either specify the URL from the command-line or co
- How to Solve Git Push Error: error: src refspec v3.3.04.1000 matches more than one
- [step on the pit] idea submits the code to GitHub and prompts 403 — the requested URL returned error: 403
- [Solved] Spring cloud config server can’t parse the YML file of the remote warehouse, and it will also report an error
- [Solved] Git push Warning: error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
- [Solved] Git Error: fatal: refusing to merge unrelated histories