0

I'm putting together a simple cloud-based Azure DevOps-based pipeline as a proof-of-concept.

I want to import a Git repo from my local machine into an Azure-based Git repo.

I'm not looking to sync the repos as this is only a PoC.

I'm a new to Azure and only have limited Jenkins/Git experience.

How do I go about this?

Thanks in advance

PS - I'm using Microsoft Visual Studio Professional 2022 (64-bit) - Version 17.8.1

5
  • I didn't understand, you want to push your local git repo into Azdo git? Commented Mar 4, 2024 at 10:33
  • Yes, that is correct. I have a git repo on my local machine that contains a demo. I can build and run that locally from Visual Studio using Cmake. I'm putting together a proof-of-concept in our new Azure tenancy and I want to use the same code to put a Azure Devops pipeline together to demonstrate Azure capabilities. This particular demo is an example of some of our software engineering capabilties and is well-known within our company. I'm more of a manager and my hands-on skills are very rusty. My main DevOps guy is off ill, so I'm having to do it myself! Commented Mar 4, 2024 at 10:41
  • Ok, Got it. take a look at this post: stackoverflow.com/questions/65367654/… in order to push your local repository to the remote repository. focus on the "A quick git tutorial" part. Commented Mar 4, 2024 at 10:51
  • Thanks, but when I try the code in that link, I get the impression that it thinks I'm tryng to push an Azure repo into my local repo - I need to do the exact opposite! Commented Mar 4, 2024 at 13:28
  • see my answer for further information about last comment. Commented Mar 4, 2024 at 13:36

1 Answer 1

0

"Cloning a local Git repo into Cloud-based Azure DevOps",

What you actually mean is pushing local files into the remote repository.


Based on our conversation in the comments, Follow those few steps to push the code to the remote repository:

  1. Create a Azure Devops Repository (If Repository already exists, skip this)

  2. On your local repository (in your IDE terminal) git init to initialize a git repo.

    2.1 If a local git repo already initialized on your filesystem (.git directory exists) use git remote -v to verify the remote. output :

azure   https://dev.azure.com/organization/project/_git/repository (fetch)
azure   https://dev.azure.com/organization/project/_git/repository (push)
  1. add all files to the staging area git add .
  2. Record the changes made to the files in the staging area git commit -m "<some commit message>"
  3. upload local repository commits to a remote repository git push -u origin <branch_name>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.