How-to use Git with Visual Studio
You can download Visual Studio from Microsoft directly. If you have difficulty finding the version you need, you may be able to find it in our saved copy in the folder here: \\Tc4s0a\groups\AARA\AARAD\Software Library\Developer Tools\Microsoft
Select a project
Open Azure DevOps
Select Repos and choose the project
Create a branch from DevOps
Open Azure DevOps
Go to Branches > New Branch
Add a name, select your work item and click on create
The standard for branch’s name: feature/PbiNumber-PbiTitle
Delete a local branch
Open Visual Studio and Clone a repository
Browse Azure DevOps repository
Connect to the training repository within dev.azure.com > transport-canada > DSD-CIVAV Support > Training
You need to track/checkout another branch before deleting the branch you want. In my case, before delete 119000-TrainingLink
I need to choose another one like Dev > right mouse button > Checkout
After this, I can delete my branch
Delete a local project
Open Windows Explorer > Go to your project path > right mouse button > Delete
Refresh the list of remote branches in Visual Studio
This was my visualisation before the refresh
Go to Team Explorer settings
Select either "Global Settings" and "Repository Settings"
Set "Prune remote branches during fetch" to
true
Go to Git > Sync (Pull then Push)
This was my visualisation after the refresh
Clone git repository with Visual Studio 2013
Connect with DevOps
Click on Select Team Projects > Servers > Add > https://dev.azure.com/transport-canada
Click on transport-canada and select DSD-CIVAV Support
Connect with the project
Clone the repository
Track your DevOps branch. When you clone the repository, the default branch will be the default branch of the DevOps repository. You need to track your branch.
Click on New Branch
Select your branch
Click on Create Branch
Open the README.md file. Click on File > Open > File > select README.md file
Clone git repository with Visual Studio 2015
Click on Team Explorer > Connect
Click on Servers > Add
Add the information from DevOps https://dev.azure.com/transport-canada > OK.
After that click on Connect
Click on this
and select the project and connect.
Click on Branches
Track/Checkout your DevOps branch. When you clone the repository, the default branch will be the default branch of the DevOps repository. You need to track your branch.
Open the README.md file. Click on File > Open > File > select README.md file
Clone git repository with Visual Studio 2019
I downloaded the visual studio 2019 community version from here.
Clone Repository
Select Azure DevOps
In this step, we need to be connected. When you are connected, we can see in the list dev.azure.com > transport-canada.
If you don’t see the option in the list, you need to add the server. Click on Add Azure DevOps Server > Add the URL https://dev.azure.com/ > Add. After that, the list will be updated.
Select transport-canada > DSD-CivAv Support > Training project. Set up your path to finish the clone.
Click on Team Explorer > Git Repository
or View > Git Repository
Track/Checkout your DevOps branch. When you clone the repository, the default branch will be the default branch of the DevOps repository. Select your branch > right button > checkout
or you can set/track/checkout your branch from here
If you received a message “A branch with the name “feature/yourbranch” already exists I advise you to start the process again. Don’t forget to delete your project folder (like I said on Delete a local project)