Search code examples
deploymentgitlabcontinuous-integrationgitlab-cicicd

remote: The project you were looking for could not be found or you don't have permission to view it


I'm getting this error while trying to deploy my branch through gitlab.

remote: The project you were looking for could not be found or you don't have permission to view it.
fatal: repository 'https://gitlab.com/[group_name]/[repo_name].git/' not found
error: Could not fetch origin

Solution

  • I managed to resolve my problem. If you're encountering the same problem, follow these steps :

    • Rename your old remote tracking :

    git remote rename origin old_origin

    • Add the new remote :

    git remote add origin https://[gitlab_username]@gitlab.com/[group_name]/[repo_name].git

    • You'll probably also have to set your default remote to origin :

    git config --add checkout.defaultRemote origin

    • And finally, you can delete old_origin if you want (optional).