I am choosing Xcode, Preferences, '+', Gitlab Account. Then I have tried lots of combinations of the Account and Token. In the Token filed I am entering the token I have generated (should it be named after the project I am going to connect?). In the Account field, I have tried to enter the mail connected with the Gitlab account, Gitlab username. However, nothing works. Please, can you help me?
2 Answers
From the Source Control navigator add the remote url of your project in GitLab. This would setup Xcode to identify where to push the commits to. Instead of adding the User Profile through Preferences (did not work for me), just go to Source Control -> Commit, and commit locally, and then Source Control -> Push to push to your repository. At this point, Xcode will ask for your username and password, just enter your credentials there and it would work like a charm from there.
I still do not have an answer to why I was not able to add the credentials via Preferences, but this works too.
Comments
Select Open in Xcode
There might be an issue to add a GitLab account on Xcode. (also Xcode supports only RSA encryption and not the ed25519 as suggested by GitLab).
Until this is fixed here is a workaround I am using!
On the GitLab repository page you can select Open in Xcode and the website will ask where to save the project, and then open it in Xcode for you.
After making changes I would commit and push with the command line. Make sure that your Git username and email match your GitLab.com account for this repository, and an SSH public key was added to your GitLab.com account.
PS. I noticed that this option appear only if GitLab can recognise the repo as an Xcode project. For this to happen, the project and the xcodeproj file should should be in a root folder.
2 Comments
xcodeproj should not be nested too deeply I believe. (I updated my answer)