{"id":38785,"date":"2017-12-08T23:03:31","date_gmt":"2017-12-08T23:03:31","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/devops\/?p=38785"},"modified":"2019-02-14T15:50:25","modified_gmt":"2019-02-14T23:50:25","slug":"new-git-features-in-vs2017-update-5","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/new-git-features-in-vs2017-update-5\/","title":{"rendered":"New Git Features in Visual Studio 2017 Update 5"},"content":{"rendered":"<p>This week we released\u00a0Visual Studio 2017 Update 5. In this release, we added new Git features which were based on your UserVoice requests to support <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-ide\/suggestions\/13316574-commit-changes-to-a-submodule-using-vs\">Git submodules<\/a>, <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-ide\/suggestions\/10575675-add-git-worktree-support\">Git worktrees<\/a>,\u00a0<a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-ide\/suggestions\/7204022-visual-studio-git-propose-to-prune-when-fetchi\"><code>fetch --prune<\/code><\/a>, and <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-ide\/suggestions\/10294356-sync-button-should-allow-git-pull-rebase\"><code>pull --rebase<\/code><\/a>. To learn more about all of our Git features and what&#8217;s new in Visual Studio 2017 Update 5, check out our <a href=\"https:\/\/www.visualstudio.com\/en-us\/docs\/git\/gitquickstart\">Git tutorials<\/a> and the <a href=\"https:\/\/www.visualstudio.com\/en-us\/news\/releasenotes\/vs2017-relnotes\">Visual Studio release notes<\/a>.<\/p>\n<h3>Git submodules and worktrees<\/h3>\n<p>Visual Studio now treats <a href=\"https:\/\/git-scm.com\/book\/en\/v2\/Git-Tools-Submodules\">Git submodules<\/a> and <a href=\"https:\/\/git-scm.com\/docs\/git-worktree\">Git worktrees<\/a> like normal repos. Just add them to your list of Local Repositories on the Team Explorer Connect page and get coding! Please note that you still cannot do anything that requires multi-repo support (such as viewing files in a parent repo and a submodule at the same time). If you would like multi-repo support, please <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-ide\/suggestions\/8960629-allow-multiple-git-repositories-to-be-active-at-on\">vote on UserVoice<\/a>.<\/p>\n<h3>Configure fetch.prune and pull.rebase<\/h3>\n<p>Ever delete a branch on the server, only to see it listed in your local list of branches? The best way to make sure your local list of branches is up-to-date is to use the <code>--prune<\/code> option when you <code>fetch<\/code>. Pruning on fetch removes local tracking branches that no longer exist on the server.<\/p>\n<p>Another common Git practice is to rebase your changes (rather than create a merge commit) when you <code>pull<\/code>. Rebasing helps keep your commit history linear and easy to follow.<\/p>\n<p>Now, it\u2019s easy to set Git to prune on every <code>fetch<\/code>\u00a0and rebase on every <code>pull<\/code>.\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/vsts\/git\/concepts\/git-config?tabs=visual-studio#configuring-settings\">Configure your default behavior<\/a> in the Global and Repository Settings in Team Explorer.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2017\/12\/GitSettings1-300x133.png\" alt=\"\" width=\"300\" height=\"133\" class=\"size-medium wp-image-38796 aligncenter\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week we released\u00a0Visual Studio 2017 Update 5. In this release, we added new Git features which were based on your UserVoice requests to support Git submodules, Git worktrees,\u00a0fetch &#8211;prune, and pull &#8211;rebase. To learn more about all of our Git features and what&#8217;s new in Visual Studio 2017 Update 5, check out our Git [&hellip;]<\/p>\n","protected":false},"author":211,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-38785","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>This week we released\u00a0Visual Studio 2017 Update 5. In this release, we added new Git features which were based on your UserVoice requests to support Git submodules, Git worktrees,\u00a0fetch &#8211;prune, and pull &#8211;rebase. To learn more about all of our Git features and what&#8217;s new in Visual Studio 2017 Update 5, check out our Git [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/38785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/211"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=38785"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/38785\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=38785"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=38785"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=38785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}