web analytics

Working With Azure DevOps

Options
@2020-06-02 22:43:09

Creating an Azure Git Repo

In Azure DevOps Services, you can create a team project with Azure Git Repos by selecting Git as the version control system during the team project creation.

1. You can click the Files submenu item to view the files of the repo.

2. Commits of the repo are listed on this page.

3. This page lets you view the code pushes.

4. Branches can be managed on this page.

5. You can manage tags from this page.

6. You can manage pull requests from this page.

7. You can copy the repo URL to clone the repo using a development tool or the Git command line.

8. This button and drop-down let you select your preferred development tool and clone the repository in that tool.

9. “Generate Git credentials” lets you define credentials to access the Git repo. Or you can click the link to create a personal access token(PAT) scoped to the code.

10. You can use these commands to push a local repository using the command line.

11. You can import a remote Git repository or a TFVC repository in the current Azure DevOps organization using this option.

12. You can initialize your repository with a .gitignore file.

Creating Additional Git Repos in a Team Project

You can create multiple Git repos in one team project unlike one TFVC repo per project. To create additional Git repos, you can use the small drop-down option near the name of the Git or TFVC repo in the breadcrumb. Then click “New repository.”

@2020-06-02 22:51:04

Clone an existing Git repo

Cloning an existing repo creates both a copy of the source code for you to work with and all the version control information so Git can manage the source code.

Get the clone URL to your repo

Before you can clone an existing repo, you'll need a URL that points to the existing repo. This URL represents the source of the repo you're going to copy.

If you're using Azure Repos, Azure DevOps Server 2019, or Team Foundation Server, you can find this clone URL in the web portal.

1.From your web browser, open the team project for your Azure DevOps organization and choose Repos, then Files.

Repos files

2.Select Clone in the upper right.

Get a clone a URL from Azure Repos

If you need to clone a GitHub repo, you'll need to get the clone URL. Use the Clone or download button while viewing the repo on the web in GitHub.

Other Git providers have similar buttons in their user interface to get the clone URL.

Copy this URL into the clipboard or store it in a place where you can find it easily. You can't clone a repo without a clone URL.

 

Cloning an Azure Git Repo

In Visual Studio, to clone and use an Azure Git repo, you have to connect to the team project. In the Team Explorer window of Visual Studio, click the Manage Connections toolbar icon and then click Manage Connections and Connect to a Project.

A dialog window will appear, and you can select or add a Microsoft account or organization account that has access to the Azure DevOps organization. Then you can expand the Azure DevOps organization and see the team projects. Expand your team project and select the Git repo. Provide a local path to clone the repository and click the Clone button.

Cloning a Git Repository from a connected Azure DevOps organization

 

Clone from another Git provider

If you aren't using Azure Repos, you can still clone your repo in Team Explorer and work with your code in Visual Studio.

1.In Team Explorer, open the Connect view, as explained above.

2.Select Clone under Local Git Repositories and enter the URL for your Git repo. Your team or Git hosting provider gives you this URL.

3.elect a folder where you want your cloned repo.

4.Select Clone to clone the repo.

Clone your repo from other providers using Visual Studio

@2020-10-31 16:42:23

Open a solution in Visual Studio from a cloned local repo

Right-click on a repository in the Team Explorer Connect view and select Open.

Open a solution from a cloned repo in Team Explorer

In the Home view in Team Explorer, double-click your project solution file in the Solutions area. The solution opens in Solution Explorer.

Double-click your project solution file in the Solutions area to open it in Team Explorer.

@2020-10-31 17:14:32

Commit your work

Git branches isolate your changes from other work in the project. The recommended Git workflow uses a new branch for every feature or fix you work on. You make commits in your local Git repository to save your changes on that branch.

1.In Team Explorer, select the Home button and choose Branches.

Screenshot showing Branches in Team Explorer.

2.Right-click the master branch and choose New Local Branch From.

Creating a Local Branch off the Master branch in Visual Studio

3.Enter a descriptive branch name for your work to remind you and others what kind of work is in the branch. Select Create Branch.

Enter a descriptive branch name and select Create Branch.

4.Make changes to your files in the cloned repo. From the Team Explorer Home view, you can open Visual Studio solutions in the repo or browse the repo contents using Show Folder View. Git keeps track of changes made to your code both inside and outside of Visual Studio.

5.When you're satisfied with the changes, save them in Git using a commit. Open the Changes view from Team Explorer by selecting the Home button and choosing Changes.

Screenshot that shows opening the Changes view.

6.Enter a message that describes the commit, and select Commit All.

Commit All

 Note

If you have multiple files and you don't want to commit them all, you can right-click each file and choose Stage. When you have staged all the files you would like to commit, select Commit StagedCommit Staged replaces Commit All when you manually stage your changes before the commit.

Stage files

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com