I am trying to connect to a Git repository hosted on VSTS from a Mac machine in Xcode 9. I tried cloning the project using Xcode but it gives me authentication failure error.
I don't get this problem in Windows. I have also tried creating a Personal Access Token in my VSTS account profile and used the secret key but that too doesn't work.
References:-
https://learn.microsoft.com/en-us/vsts/git/share-your-code-in-git-xcode
https://learn.microsoft.com/en-us/vsts/git/set-up-credential-managers
Am I missing on something? Please let me know if I can provide more details.
Update
Somehow I can clone the project to my local using Visual Studio on Mac after generating Git credentials through VSTS. Strange that it does not work with the XCode.
I have not used VSTS, but this answer shows how to connect to a remote repository that's not a GitHub repository in Xcode 9. Start by opening the source control navigator by choosing View > Navigators > Show Source Control Navigator.
The next step is to add a remote branch for your VSTS repository. Select the Remotes folder in the source control navigator, right-click, and choose Add Existing Remote.
Enter the URL of your VSTS repo in the Location text field. Click the Add button to finish adding the remote repository.
At this point you have an empty remote repository in Xcode. The last step is to push your local Xcode repository to the remote repository. Choose Source Control > Push in Xcode to do the push.
You will be asked for a username and password for the remote repository. According to the first link from Microsoft in your question, you should enter your VSTS username as the username and the personal access token as the password.
Related
I've been trying to setup a GitHub repository for a xaramin iOS project that I'm doing on my mac.
When creating the project, this is the settings I chose
Setup Image
However on I haven't been able to push to the GitHub repo I want to, I've tried to follow Microsofts guide https://learn.microsoft.com/en-us/visualstudio/mac/set-up-git-repository but it hasn't worked due to Publish in version control being greyed out
Or, if your project is already bound to a git repository, simply add the GitHub remote and push it there.
git remote add github URL_TO_GITHUB_REPO
git push github master
Afterwards, Visual Studio should allow you to push to Github as well as any older remotes that were added locally.
You can always remove the existing remote if you want to:
git remote remove origin
git remote rename github origin
See also: https://stackoverflow.com/a/52052063/736079
Before publishing your project to GitHub from Visual Studio, you must remove any source control :
If you have an existing project that is
not already in version control, use the following steps to set it up
in Git
Removing the .git folder and .gitgnore file should be enough. Then the "Publish in version control..." menu will be available (you might need to restart Visual Studio).
Source : https://learn.microsoft.com/en-us/visualstudio/mac/set-up-git-repository?view=vsmac-2019#publishing-an-existing-project
I'm trying to check in an existing project into a fresh new repository on VSTS.
I've connected to the repository in Team Services. When I right click my solution and select Add Solution to Source Control, I get the following errors. After that nothing happens. Any idea how to fix this?
You need to create an appropriate workspace so that there is a mapping between your TFVC repository and your local file system.
I want configure visual studio code to push change's project to GitLab.
I'm using Linux. Every time that I try do push, show this message to me:
Username for 'https://gitlab.com':
I generated ssh key and put in the GitLab user setting.
Git init, add. and commit works fine.
I generated ssh key and put in the gitlab user setting.
If Visual Studio is asking about https, that means the remote URL associated with your local Git repo is not an ssh one.
In command-line, go to your repo root folder, and type:
git remote origin set-url git#gitlab.com:<yourAccount>/<yourRepo.git>
That will help Visual Studio Code pick the right URL (the one for which you registered your credentials through your public SSH key)
OR: you might want to keep your current https URL, but cache your GitLab username/password (since you don't want to have to enter them every time).
See "Use Git Credential Managers to Authenticate to Visual Studio Team Services" (it should apply to Visual Studio Code as well, and works on Windows or on Linux)
I have a GitHub account.
I have a Visual Studio 2010 with Git Extensions and Git Source Control provider installed.
I have created a clean project. How do I upload it to GitHub?
P.S. A tutorial on this particular topic would be fine.
In order to upload a Visual Studio Project to GitHub one needs to perform a push operation in GitExtension commit dialog.
Basically syncing the project with GitHub server is called "push"ing in Git terminology.
In order to be able to push, one needs to do the following:
Create a local repository. This is covered in detail by both GitHub and GitExtensions manual.
Create a repository online from GitHub account. This is covered in detail by GitHub help.
Map a local repository to an online one. This requires going to Manage Remotes dialog of GitExtensions (accessed via Git->Manage Remotes menu item in Visual Studio main menu) and saving a new instance of a remote repo.
Then, at commit, choose to "Commit & push", and point push to a remote repo created in step 3.
Create a new repository in your github account. It will give you the step by step instructions for you.
In my office, I have a working repository, where I am able to work on my laptop to modify files and commit them to that repository. I am using a local URL for this, which points directly to the PC containing the repository. Additionally, we published this repository for external users as well, so they are able to make changes to the repository without being on our local network. All is working fine there. However, my laptop which normally using the local connection, now needs to be moved to one of those external locations. I would like to be able to change the URL in my solution in Visual Studio, without having to 'create project from SVN'
Navigate to View -> Pending Changes.
You can see the Pending Changes prompt at the bottom.Then Select the drop down on the top right and select other option. Provide the new URL and click on OK button.
Done!
Whay you need is relocate (NOT switch) to tell your working copy that the URL of the repository changed (from your local URL to the external URL).
In the thread Collin linked to is most likely the correct answer:
How to switch subversion repository in Visual Studio using AnkhSVN?
How to switch subversion repository in Visual Studio using AnkhSVN?