I downloaded the example of Google, made my changes and now I want to upload it to the gitlab gitlab ,

did these commands

cd existing_folder

git init

git remote add origin https://gitlab.com/rosental/Mobile.git

git add.

Then I went to the studio to make a commit, it went through, but when I push, I get this error

enter image description here

As far as I understand, then in the project folder the git file has already been initialized, since the error shows that he is trying to push it to the address of the Google repository, and not to my ...

How can this be fixed? Where is it indicated?

  • git remote set-url ? - αλεχολυτ
  • @alexolut And how to use this command correctly? - Aleksey Timoshchenko
  • @ Yuriy SPb is not ... I need to go to gitlab ... I added a description to the question there - Aleksey Timoshchenko
  • one
    403? It seems the guitarb does not recognize you in makeup. - D-side

1 answer 1

Run this command:

 git remote set-url origin https://gitlab.com/rosental/Mobile.git 

And then, to send everything to the server:

 git push origin master 
  • Yes, this is what was needed ... Can you please explain how it worked? What was the problem? - Aleksey Timoshchenko
  • 2
    @AlekseyTimoshchenko when you downloaded the project, a different repository was specified for this project in the Git configs, on Github (the link to it can be seen on the screen that you threw, at the top right in notifications). In order to push into your repository (on gitlab) you need to change the link. The git remote add origin command sets the path to the repository when there is none. But the path to the repository was already on (on github), then it needs to be replaced (on gitlab), the git remote set-url origin command git remote set-url origin does just that, changes the path in the git configuration to the project. - SkiesX
  • Everything became clear immediately)) Thank you! - Aleksey Timoshchenko