BT

Visual Studio 2017 Now Supports Git Via SSH

| by Jeff Martin Follow 16 Followers on Mar 28, 2017. Estimated reading time: 2 minutes |

Git remains a growing, if not an essential part of most developer's toolkits, and making its myriad of features accessible is an important part of any modern IDE. In Visual Studio 2017, Microsoft has expanded the number of Git features available to developers from its UI rather than having to resort to using Git from the command line.

Included among the new features is SSH support for VS2017's Git client. Microsoft's Kayla Ngan observes that this is possible thanks to VS2017 switching to using git.exe to provide its Git support. Previously, Git support under Visual Studio required https to be configured on the server hosting the repository which limited accessibility. Unfortunately, full SSH support remains incomplete because one cannot clone a repository via SSH from within the IDE. Instead, the repository has to be cloned from Visual Studio's Developer Command Prompt, after which the repository is pushed/pulled/etc. as needed. Ngan says that the ability to clone from within the IDE will be added in a future update (note that this does affect the cloning of Git repositories via https).

Another new Git addition is in the Global Settings screen for Git (under Team Explorer) where there is a new option to add push --force-with-lease which will alert you before executing a push that would otherwise overwrite someone else's work (due to changes in the upstream branch). The warning will not prevent the push, but rather provide the opportunity to confirm that this is your intention.

Viewing and comparing the diffs is easier in VS2017. A summary of outgoing commits is visible from the Sync page. Added to this is the ability to view the Local History of the commits for your repository and compare two different diffs with the Compare Commits context menu option.

There are some additional requested Git features that remain on the future roadmap, including:

  • Pushing tags to the remote server
  • Fetch --prune
  • Pull --rebase

A frequently reported error message with those using VS2017 in their current workflow is "Index was outside the bounds of the array."  According to user Rain, the solution is to commit changes before making a pull request—while another user Tony indicated that this error coincided with his inability to make any kind push.

Those interested in more information regarding VS2017 and Git can reference Microsoft's quick start guide which includes instructions for those using previous versions of Visual Studio.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT