1. The questions are as follows:
echigh@huangchenggong:/mnt/e/work/workspace/withdraw_validdata_from_file/withdraw$ git push -u origin main
Username for 'https://github.com': echigh
Password for 'https://[email protected]':
To https://github.com/echigh/withdraw_frontbytes_of_file.git
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'https://github.com/echigh/withdraw_frontbytes_of_file.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.
2. The reason is that the remote warehouse has been changed and does not match any local commit version
Reference: [status question] why can’t you push it up sometimes… – learn git for yourself
3. Solution:
1) Merge remote changes with git pull before git push
2) Directly use git push – F to forcibly overwrite the remote warehouse. Anyway, I dare not
4. So I did this:
echigh@huangchenggong:/mnt/e/work/workspace/withdraw_validdata_from_file/withdraw$ git pull
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 21 (delta 13), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (21/21), 5.03 KiB | 66.00 KiB/s, done.
From https://github.com/echigh/withdraw_frontbytes_of_file
c6d3d5e..e50b1bc main -> origin/main
Merge made by the 'recursive' strategy.
README.md | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 README.md
Then push:
echigh@huangchenggong:/mnt/e/work/workspace/withdraw_validdata_from_file/withdraw$ git push
Username for 'https://github.com': echigh
Password for 'https://[email protected]':
Enumerating objects: 44, done.
Counting objects: 100% (42/42), done.
Delta compression using up to 8 threads
Compressing objects: 100% (38/38), done.
Writing objects: 100% (38/38), 3.16 MiB | 994.00 KiB/s, done.
Total 38 (delta 19), reused 0 (delta 0)
remote: Resolving deltas: 100% (19/19), completed with 2 local objects.
To https://github.com/echigh/withdraw_frontbytes_of_file.git
e50b1bc..b7684a5 main -> main
Read More:
- Git Push Error: failed to push some refs to ‘[email protected]:
- hint: Updates were rejected because the remote contains work that you do To XXX
- [Solved] Git submits locally to the remote warehouse Error: failed to push some refs to…
- Local repository upload to remote repository error: failed to push some refs to ‘https://hub.fastgit.org/zhizhangxuezhang/ui-test.git‘
- [Solved] Git Common Error: error: src refspec xxx does not match any/error: failed to push some refs to
- How to Solve Git Error: error: failed to push some refs to……
- Git Push remote error: GH007: Your push would publish a private email address.
- Git push Submit to Remote Error: “remote: Support for password authentication was removed on August 13, 2021.“
- [Solved] error: failed to push some refs to ‘https://gitee.com/wangdxstudy/mygirl.git‘
- [Solved] Git Push Error: &fatal: the remote end hung up unexpectedly
- [Solved] Git push Warning: error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
- [Solved] Git push Error: remote: Support for password authentication was removed on August 13, 2021.
- Git fatal: No configured push destination. Either specify the URL from the command-line or co
- [Solved] Git push error: error: RPC failed; HTTP 413 curl 22 the requested URL returned error: 413
- Git push Failed to connect to localhost port 1080 [How to Solve]
- Git Push Error: Proxy CONNECT aborted [How to Solve]
- How to Solve Git Push Error: error: src refspec v3.3.04.1000 matches more than one
- Git push error: error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
- Git push error: RPC failed; curl 7 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054
- [Solved] Git Push error: File: xxx 252.15 MB, exceeds 100.00 MB.