Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions book/A-git-in-other-environments/sections/visualstudio.asc
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
=== Git in Visual Studio

(((Visual Studio)))
Starting with Visual Studio 2013 Update 1, Visual Studio users have a Git client built directly into their IDE.
Visual Studio has had source-control integration features for quite some time, but they were oriented towards centralized, file-locking systems, and Git was not a good match for this workflow.
Visual Studio 2013's Git support has been separated from this older feature, and the result is a much better fit between Studio and Git.
Visual Studio has Git tooling built directly into the IDE, starting with Visual Studio 2019 version 16.8.

To locate the feature, open a project that's controlled by Git (or just `git init` an existing project), and select View > Team Explorer from the menu.
You'll see the "Connect" view, which looks a bit like this:
The tooling supports the following Git functionality:

.Connecting to a Git repository from Team Explorer
image::images/vs-1.png[Connecting to a Git repository from Team Explorer]
* Create or clone a repository.
* Open and browse history of a repository.
* Create and checkout branches and tags.
* Stash, stage, and commit changes.
* Fetch, pull, push, or sync commits.
* Merge and rebase branches.
* Resolve merge conflicts.
* View diffs.
* ... and more!

Visual Studio remembers all of the projects you've opened that are Git-controlled, and they're available in the list at the bottom.
If you don't see the one you want there, click the "Add" link and type in the path to the working directory.
Double clicking on one of the local Git repositories leads you to the Home view, which looks like <<vs_home>>.
This is a hub for performing Git actions; when you're _writing_ code, you'll probably spend most of your time in the "Changes" view, but when it comes time to pull down changes made by your teammates, you'll use the "Unsynced Commits" and "Branches" views.
Read the https://docs.microsoft.com/visualstudio/version-control[official documentation^] to learn more.

[[vs_home]]
.The "Home" view for a Git repository in Visual Studio
image::images/vs-2.png[The “Home” view for a Git repository in Visual Studio]

Visual Studio now has a powerful task-focused UI for Git.
It includes a linear history view, a diff viewer, remote commands, and many other capabilities.
For more on using Git within Visual Studio go to: https://docs.microsoft.com/en-us/azure/devops/repos/git/command-prompt?view=azure-devops[].
Binary file removed images/vs-1.png
Binary file not shown.
Binary file removed images/vs-2.png
Binary file not shown.