Git push origin main.. returning remote repository not found

Viewed 112

I was invited to a project in github organization, I clone the project make some changes and also pull changes from the branch But when I try to do git push, it return remote: repository not found. fatal: repository 'https://github.com/MJTechNG/i-next.git/' not found

I check git remote -v and I got.. origin https://github.com/MJTechNG/i-next.git (fetch) origin https://github.com/MJTechNG/i-next.git (push)

which is the right branch I believed. But I can't seems to get why can't I push to the origin. So I thought may be I don't have right permission but I don't think that is the case, because I can create new branch in the organization and git push or pull everything works fine in the branch I created in the org. Please can you help me discover what seems to be the issue? Thank you

1 Answers

Can you try fetching all branches and check you have a branch called "main".

If you want to force push,

BE CAREFUL, will override the remote branch with your current local version.

git push -f origin main

Or you can do force push with a lease which fails if there are new commits on the remote that you didn't expect (technically, if you haven't fetched them into your remote-tracking branch yet) - useful if you don't want to accidentally overwrite someone else's commits that you didn't even know about yet, and you just want to overwrite your own:

git push --force-with-lease origin main

Related