Unfortunately, I pushed the wrong repo to my repo, then I delete the wrong codes and try to upload my new original code to this repo.
But every time I get this kind of error. When I try to git push -u origin main push my code to this repo, GitHub rejects it. How do I fix this problem?
Asked
Active
Viewed 21 times
-3
-
1If you want to overwrite the remote repo data, use `git push --force`. – choroba May 05 '22 at 11:38
-
https://stackoverflow.com/search?q=%5Bgit%5D+hint%3A+Updates+were+rejected+because+the+remote+contains+work+that+you+do – phd May 05 '22 at 11:49
-
`git push -f -u origin main` – phd May 05 '22 at 11:49
-
yes, it works, and now I can push my project code. Many many thanks a lot to you – Shahrear ahamed May 06 '22 at 19:15