Microsoft has built the Microsoft Git provider into Visual Studio since Visual Studio 2013, but Visual Studio can have only one source control provider at a time. In order to make the Git functions compatible with Microsoft Git provider, we have created another extension - Git Tools. So that it can run side by side with Microsoft Git Provider. Open the GitHub pane by typing GitHub into Visual Studio Quick Launch (Ctrl+Q). Create Pull Requests from Visual Studio Turn a branch into a Pull Request directly from Visual Studio. In the GitHub pane, click the Create New link to create a new Pull Request on GitHub.

Install above vscode (version >=1.42.0) and The git plugin needs to be installed.
Follow the Angular Team Commit Specification,like the following:
Type
Must be one of the following:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing or correcting existing tests
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
Scope
The scope could be anything specifying place of the commit change. For example $location
, $browser
, $compile
, $rootScope
, ngHref
, ngClick
, ngView
, etc...
You can use *
when the change affects more than a single scope.
Subject
The subject contains succinct description of the change:
- use the imperative, present tense: 'change' not 'changed' nor 'changes'
- don't capitalize first letter
- no dot (.) at the end
Git In Visual Studio
Body
Just as in the subject, use the imperative, present tense: 'change' not 'changed' nor 'changes'. The body should include the motivation for the change and contrast this with previous behavior.
The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit closes.
Breaking Changes should start with the word BREAKING CHANGE:
with a space or two newlines. The rest of the commit message is then used for this.
A detailed explanation can be found in this document.
Quick start
Step1 Install the plugin
Step2 Use the command shortcut
showGitCommit
to open the command window or Click the icon on the git plugin navigation barStep3 Enter the commit information, which automatically generates a commit message that conforms to the specification
Settings Options
GitCommitPlugin.ShowEmoji
: whether to show emoji, defaulttrue
.
GitCommitPlugin.CustomCommitType
: customize the commit type, defaultnull
.
GitCommitPlugin.MaxSubjectWords
: customize the maximum number of words on the subject, default20
.
license
MIT
-->Azure Repos | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018 - TFS 2015 | VS 2017
Azure DevOps Server was formerly named Visual Studio Team Foundation Server (TFS).
Get up and running using Git with code already in Azure Repos.For more information on how to use Git from Visual Studio or the command line, see Azure Repos Git tutorial.
If you don't have your code in an Azure Repos or Azure DevOps Server Git repo, visit our Visual Studio or command line getting started articles to learn how to create a local repo for your code and push it to Azure Repos.
Note
Visual Studio 2019 now includes a new Git tool that provides an improved experience when connecting to a Git repository. When you enable this tool, the Team Explorer tool is effectively disabled when connected to a Git repository. You can acquire the new tool by downloading Visual Studio 2019 version 16.6. To enable and use the new tool, see Git experience in Visual Studio (Preview).
Get your code
To get a copy of the source code, you clone a Git repository. Cloning 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.
If you don't have a Git repository yet, you can create one using your own code. Continue with the steps in this article to commit and share your work.
Note

Visual Studio 2019 now includes a new Git tool that provides an improved experience when connecting to a Git repository. When you enable this tool, the Team Explorer tool is effectively disabled when connected to a Git repository. You can acquire the new tool by downloading Visual Studio 2019 version 16.6. To enable and use the new tool, see Git experience in Visual Studio (Preview).
In Team Explorer, select Connect to open the Connect page, and then choose Manage Connections > Connect to Project.
In Connect to a Project, select the repo you want to clone and select Clone. If you don't see your repo, select Add Azure DevOps Server to add a server that hosts a repo. You can filter the list to find your repo.
Note
Project URLs have changed with the release of Azure DevOps Services and now have the format
dev.azure.com/{your organization}/{your project}
, but you can still use the existingvisualstudio.com
format. For more information, see Visual Studio Team Services is now Azure DevOps Services.Verify the location of the cloned repo on your computer and select Clone.
Download and install Git and the Git Credential Manager for your platform.
Open the Azure DevOps Services web portal in your browser by going to
https://<your account name>.visualstudio.com
.Open the Azure DevOps Services web portal in your browser by navigating to
https://<your account name>.visualstudio.com
and find your Git repository. Copy the clone URL from the Clone pop-up.Note
Project URLs have changed with the release of Azure DevOps Services and now have the format
dev.azure.com/{your organization}/{your project}
, but you can still use the existingvisualstudio.com
format. For more information, see Visual Studio Team Services is now Azure DevOps Services.At the command prompt, go to the folder where you want the code stored on your local computer.
From the command prompt, run
git clone
followed by the clone URL, as shown in the following example.Git downloads and creates your own copy of the code in a new folder for you.
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.
Note
Visual Studio 2019 now includes a new Git tool that provides an improved experience when connecting to a Git repository. When you enable this tool, the Team Explorer tool is effectively disabled when connected to a Git repository. You can acquire the new tool by downloading Visual Studio 2019 version 16.6. To enable and use the new tool, see Git experience in Visual Studio (Preview).
In Team Explorer, select the Home button and choose Branches.
Right-click the main branch and choose New Local Branch From.
Enter a descriptive branch name for your work to remind you and others what kind of work is in the branch. Select Create Branch.
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.
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.
Enter a message that describes the commit, and select 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 Staged. Commit Staged replaces Commit All when you manually stage your changes before the commit.
Create a branch where you make your changes to the code. If you're collaborating with someone using a branch they've created, you can skip to the following
git checkout
step.Choose a descriptive branch name for your work to remind you and others what kind of work is in the branch.
Check out your branch so you can start working in it.
You can also use the
checkout
command to start working on a branch that other team members are already working in.Make changes using your favorite tools on the code.
When you're satisfied with the changes, even if you aren't ready to share the work, save them in Git using a commit. Your changes won't be shared until you push them, as described in the following section.
This command saves your changes locally to a new commit in Git. Make sure to give the commit a short message that describes your changes after
-m
.
Share your changes
Visual Studio Git Plugin Settings
When you're ready to share your changes with the team, push those changes so that others can reach them. You can onlypush changes after you add commits to a branch.
Once you push the changes, you can create a pull request. A pull request lets others know you'd like to have the changes reviewed. After approval, a pull request adds your changes to the main branch of the code.
Note
Visual Studio 2019 now includes a new Git tool that provides an improved experience when connecting to a Git repository. When you enable this tool, the Team Explorer tool is effectively disabled when connected to a Git repository. You can acquire the new tool by downloading Visual Studio 2019 version 16.6. To enable and use the new tool, see Git experience in Visual Studio (Preview).
Visual Studio Git Plugin Ssh
In Team Explorer, select Home and then choose Sync to open Synchronization.
You can also go to the Synchronization view from Changes by choosing Sync immediately after making a commit.
Select Push to share your commit with the remote repository.
If this push is your first to the repository, you'll see the following message:
The current branch does not track a remote branch. Push your changes to a new branch on the origin remote and set the upstream branch.
Select Push to push your changes to a new branch on the remote repository and set the upstream branch. The next time you push changes, you'll see the list of commits.Create a pull request so that others can review your changes. Open Pull Requests in Team Explorer by selecting Home and choosing Pull Requests.
In Pull Requests, you can view pull requests opened by you, assigned to you, and you can create new pull requests. Select New Pull Request to open a web browser where you can create the new pull request in the Azure Repos web portal.
Verify your branches. In this example, we want to merge the commits from the
ReadMeFix
branch into themain
branch. Enter a title and optional description, specify any reviewers, optionally associate any work items, and then select Create.For more information on pull requests, see the pull request tutorial.
Push your branch so that others can see the changes you've saved.
Open the project in the web portal and browse to your repository under the Code tab. Select Create a pull request to create a pull request for the branch that you pushed.
Verify your branches. In this example, we want to merge the commits from the
ReadMeFix
branch into themain
branch. Enter a title and optional description, specify any reviewers, optionally associate any work items, and select Create.Once the changes are approved, complete the pull request.A complete pull request adds your changes from the branch into the main branch of the code.
For more information on pull requests, see the pull request tutorial.
Sync with others
To keep your code up to date, pull commits made by others and merge them into your branch.Git is very good about merging multiple changes even in the same file, but sometimes you might have to resolve a merge conflict.It's a good idea to pull your branches regularly to keep them up to date with the changes from others.Pulling often makes sure that your feature branches from your main branch are using the latest version of the code.
Note
Visual Studio 2019 now includes a new Git tool that provides an improved experience when connecting to a Git repository. When you enable this tool, the Team Explorer tool is effectively disabled when connected to a Git repository. You can acquire the new tool by downloading Visual Studio 2019 version 16.6. To enable and use the new tool, see Git experience in Visual Studio (Preview).
In Team Explorer, select Home and choose Sync to open Synchronization.
You can download the latest changes to your branch using the Pull link. There are two Pull links, one near the top and one in the Incoming Commits section. You can use either because they both do the same thing.
Switch to the branch where you want to download the changes others have made.
In this example, you pull changes made by others on your team to the
ReadMeFix
branch to your local copy of the branch.Pull the changes made by others to your local branch.
Git downloads the changes and merges them with your own changes into your local branch.
