X
17Apr

Integration of Git into Visual Studio

Nearly all versions of the Visual Studio IDE provide integration features for source control. Git Client is directly built into all the latest versions of Visual Studio IDE. This documentation is about using git in Visual Studio 2019 version.

Git Cloning Process: -

1. All features relevant to Git are available at the ‘Team Explorer’ section. To locate this feature, select from the menu ‘View > Team Explorer’ option that appears as follows in Visual Studio 2019 IDE.

1

2. To clone a git repository from a remote server by using URL, select the ‘Clone’ option from the ‘Team Explorer’ section and provide the git URL, then click again on the ‘Clone’ option as shown below.

2

3. After the cloning is done, projects will be appearing in ‘Solution Explorer’ section as shown follows.

3

Git Operations (Commit, Push, Pull and Fetch): -

1. Using the ‘Team Explorer’ feature, we can commit, push, and pull the changes into a local/remote repository. All the git operations and projects of the git related are available here as shown below.

4

2. Let's make some changes in 'Program.cs' file (e.g. inserted comment line), as shown below. All the new/modified files appear in ‘Changes’ area then write a meaningful commit message and press the ‘Commit and Push’ button. Also, check the changes reflected in the remote repository page below.

5

6

3. Pulling changes made by other project team members. The image below shows changes that are pulled from remote repository. Go to 'Team Explorer' section and Select ‘Sync > Pull’ Option.

7

Creating and Switching Git Branches: -

1. To create a new branch, from ‘Team Explorer’ section, select ‘Branches > New Branch’ option then give the branch name and press ‘Create Branch’ button.

8

2. To switch the branches, from ‘Team Explorer’ section, select ‘Branches’ and Right-click on the branch which you want to shift then select ‘Checkout’ option.

9

Solving Conflicts: -

Whenever two team members of the team change the same file, conflicts may occur. So, we need to fix such conflicts manually.

1. Let’s take an example of ‘Program.cs’ file only. Suppose Person A makes changes and Person B also makes changes to the same file, then there can be conflicts as shown below.

10

2. After the changes have been manually merged/fixed, save the file to mark the conflicts as resolve and press the ‘Commit Merge’ button to fix the conflict from ‘Team Explorer’.

11

Related

Accelerating Digital Transformation with GitHub

Hi All, in this blog I would like to share few insights on how you can leverage GitHub for your deve...

Read More >

GitHub Product Purchasing Details

In the previous blog we would have seen what GitHub is, who started this project and how it evolved ...

Read More >

Intro to Git and GitHub and Difference

Let us check what is Git and GitHub and how they work. To understand this, let us imagine a scenario...

Read More >

Git Command line Options

Git is a free and open source distributed version control system designed to handle everything from ...

Read More >

Migration Process of SVN to Git

Subversion (SVN) is a central version control system (VCS) while Git is a distributed version contro...

Read More >

GitHub - Administration

To understand GitHub, you must first have an understanding of Git. Git is an open-source version con...

Read More >

Migrating TFS 2013 Version Control to TFS Git with changeset history

There are several articles on the web describing the migration technique with minimal details. This ...

Read More >

Share

Post a Comment

Try DevOpSmartBoard Ultimate complete Azure DevOps End-to end reporting tool

Sign Up

  • Recent
  • Popular
  • Tag
  • Key Metrics to Measure DevOps Success

    DevOps words means many things to many people and all the definitions might be partly right. DevOps is all about continuously seeking feedback, understanding challenges, and improving the way the soft...
  • Bulk Export Import Test Cases to Azure DevOps Test Plans using CSV file

    As a user of Azure DevOps Test Plans or TFS Test Management for manual testing, from a long time everyone including me had a wish, that copy of test cases from excel or csv file along with test steps ...
  • Azure DevOps Overview

    Now a days Azure DevOps is very famous with IT and Operations team along with developers, so what is Azure DevOps? It is a Software as a service (SaaS) platform from Microsoft that provides features r...
  • Volume Management in Kubernetes

    Since pods created in k8s are ephemeral, we are able to get the data as long as pods are alive, but if pods are terminated data stored in it completely lost and it cannot get back, for that we need to...
Tags
Monthly Archive
Subscribe
Name

Text/HTML
Text/HTML
Contact Us
  • *
  • *