Importing an existing local git repository into Azure Devops - github

My company has an old local git repository, which I'm trying to add to Azure Devops but so far, I've been unsuccessful (I've never setup a repository in Devops before, so I'm very new to this).
I've been trying to add this to devops by going into Repos > Import Repository, however when I attempt to import, I receive the following error:
I know this repository exists because I'm able to open this repository url via visual studio and work with the project within there, however when I attempt to import it into azure devops, I'm receiving that issue.
I've tried both providing authentication username & PAT....and I've attempted with no authentication. Neither seems to work.
Any idea what I'm doing wrong to get this imported into devops?
Thanks

Related

Azure pipeline to build xcode project can't clone repo

I would like to know if you have any ideas of what happens to the following pipeline I'm developing to build an xcode project.
I'm configuring a pipeline with the xcode build, copy files, and publish artifact tasks.
I have configured the build task, with my xcworkspace path, and set up the scheme
I have all of my repos, in bitbucket, but I have set it up a service connection between my Azure devops, and bitbucket, using an app password, which have all the permissions allowed, I have developed a pipeline to build an Android app, and I don't have problems with that one, just to mention that this one doesn't depends on other separated repos
The thing is that, the developer separated the api client in a repo, from the main repo were the iOS code is, so when Azure tries to clone this repo, it can't be done, due to a host key verification, he told me that this repo is dependency of the main iOS repo.
This is the error
I'm new to Azure devops, but I have searched for solutions, and nothing. I understand that I have to configure an SSH key, but, I'm using a pipeline with a hosted microsoft agent. Should I add a task to actually set up this SSH key to the agent? Or it is only permission problems?
The things I have done, are:
Creating the app password again, with all permissions set
Change my project path, and use the correct scheme, cause I was using the wrong one. But there's no difference
The only thing I have left is to add the user from my Azure devops to a group of admins, who actually have permissions to the repo Azure is trying to clone. But I need to open a ticket with my partner, cause I cannot logged into the mail account.

Import azure devops code from one repository to another repository in same project

I am importing the code from one azure Devops repository to another repository in same project. while doing source code import to new repository. Import file option is not there.
workaround I did is below-
I cleaned the new Repository and then from old source code repository cloned the URL. used this URL to import in new repository -> File option -> import. Import option didn't appear. doc link here - https://learn.microsoft.com/en-us/azure/devops/repos/git/import-git-repository?view=azure-devops#import-into-an-existing-empty-repo
used the power shell script from this Microsoft documentation- https://learn.microsoft.com/en-us/azure/devops/repos/git/import-git-repository?view=azure-devops#manually-import-a-repo-using-az-repos-cli . using this script getting error "The User aaaaaaaaaaa-aaaaa-aaaa-aaaaaaaaa is not authorized to access this resource".
Can you please guide me to steps to move code from one repo to another in azure Devops?
Thank you!
You could clone the current repo to a new one both using "git commands" and from Azure DevOps UI. Please make sure the structure of both repos are the same and you have the corresponding permission to act with code in Azure DevOps.
1.From DevOps UI (Git as an example)
Paste the original repo's URL from browser:
https://dev.azure.com/{OrgName}/{ProjName}/_git/{OriginalRepoName}
Using DevOps PAT for authentication.
2.For Git commands, you could refer to this link for details: work on a repository from a different organization devOps
I'm not understanding why you need a special "import option" for this. Maybe you mean something by "import" that I'm not understanding? Why can't you just:
Check out both SourceRepo and DestRepo to your workstation.
Copy the source code from your SourceRepo working folder to your DestRepo working folder.
Commit and push DestRepo.

Create "Pull Request" in Sourcetree for Azure DevOps

I tried to create pull request in Sourcetree,
but it asked me to set Remote Project Configuration.
In the remote setting there is only 3 host types for this: Bitbucket, GitHub, Bitbucker Server.
there is no option for Azure DevOps
Is there is a solution for this?
I think you have an old version - that explains why the AzureDevOps option is missing.
UPDATE: Try adding a local repository instead remote

Azure Visual Studio 2019 failed to push to Azure DevOps Git

Background
I have an Azure Synapse SQL server which have some tables and stored procedures. Visual Studio 2019 (VS2019) is connected to the SQL server using Active Directory Interactive Authentication with use name being a Service Account Email.
I have built a Azure DevOps Demo, with following setups (Organization, Project, Git Repository).
I have added the Service Account Email to the Azure DevOps project and repository level, with contributor access.
I am trying to synchronize the stored procedures with my Azure DevOps Repository.
I am able to use VS2019 > Team Explorer > Manage Connections, and set the Service Account Email as the "hosted repositories for", and see my Repositories appear in the list.
Problem
It turned out that when I try to push Git Changes, by Team Explorer > New Repository > Existing remote, where I entered the full URL of my repository https//dev.azure.com/%Organization%/%Project%/_git/%Repository%, following error turned up: Git failed with a fatal error. unable to access 'above URL': SSL certificate problem, unable to get local issuer certificate. How can I resolve this error?
How to push all of my existing stored procedures to my Repository?
Faced the same issue, requesting you to go through the link. Hope this will resolve the issue:
Authentication failed for https://xxx.visualstudio.com/DefaultCollection/_git/project

Migrating from Bitbucket Server to Azure DevOps

While importing from Bitbucket Server which is accessible over VPN to Azure DevOps, I am facing the issue as "Clone URL is incorrect. Clone URL requires authorization". May I know how to fix this issue.
And I saw import repository option in Azure DevOps. But is there any way to import multiple projects and their repositories of Bitbucket Server to Azure DevOps?
Here is a suggestion ticket about add support for Bitbucket Server for Azure DevOps. You can vote this ticket.
As a workaround, you can use git commands to clone and push your repositories.
1.Clone the source repo to a temporary folder on your computer using the bare option.
git clone --bare https://github.com/contoso/old-contoso-repo.git
cd old-contoso-repo.git
2.Create a target repo.
3.Copy the source repo to the target repo.
git push --mirror https://dev.azure.com/contoso-ltd/MyFirstProject/_git/new-contoso-repo
Please find more detailed information in this document.
In Azure DevOps Import will happen from source repository URL's which are reachable from Azure DevOps Services which are basically running on cloud and require HTTPS reachability.
If BitBucket Server is hosting Repository on Private Network , it will not be reachable from Azure DevOps and hence we need the method provided by Walter above.