So I came across with this decision in life that I need to import an existing Git project from an organization's DevOps to my own DevOps.
Being a newbie to Azure DevOps, my initial plan was to of course grab a copy of it from my local machine and then commit the project to the new DevOps. But I was a bit skeptical about the fact that I will not be able to see all the commit history from the old DevOps.
As I search for a solution, I found out that there are actually lots of ways to do it. But maybe due to some permission issues, those steps lead me to nowhere. Luckily, I found this effective solution for my situation.
Here are the steps to do it:
Using your favorite terminal, git clone your source project to your machine's temporary folder storage.
In my case:
git clone --bare https://github.com/contoso/old-contoso-repo.git
Now, navigate to the cloned project. Mine was:
cd ProjectTobeImport.git
Let's now copy the source to our destination repository:
git push --mirror https://dev.azure.com/jvalenzona/_git/ReactProject
And that's it! My source project was successfully imported. All the source commits history are also intact.
Source: dev.azure.com/tofuthegreat08/_git/ProjectTo..
Destination: dev.azure.com/jvalenzona/_git/ReactProject
Btw, you can also explore other ways of importing that will suit your needs: docs.microsoft.com/en-us/azure/devops/repos..