<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>phkelley's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/phkelley/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/phkelley/feed.xml</link>
    <description>TFS Version Control</description>
    <lastBuildDate>Mon, 13 Apr 2015 03:48:20 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Adding a corporate (or self-signed) certificate authority to git.exe’s store</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store</link>
      <pubDate>Mon, 20 Jan 2014 08:54:35 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2014/01/20/adding-a-corporate-or-self-signed-certificate-authority-to-git-exes-store/</guid>
      <description><![CDATA[This is a topic that I touched on a little bit in my last post, "Git network operations in Visual...]]></description>
      <content:encoded><![CDATA[<p>This is a topic that I touched on a little bit in my last post, "<a href="https://blogs.msdn.com/b/phkelley/archive/2013/10/20/git-network-operations-in-visual-studio-2013.aspx">Git network operations in Visual Studio 2013</a>.&rdquo; If your organization has an on-premises installation of Team Foundation Server 2013 or later, and you connect using HTTPS, then the root certificate which vouches for the authenticity of your SSL cert is probably private to your organization. That root certificate is probably distributed to all domain-joined machines in your organization via group policy, and it is stored in the Windows certificate store for your machine.</p>
<p>Any application written to use the Windows crypto APIs will have access to that root certificate, and will consider your TFS deployment to be trusted. Applications using the Windows certificate store include Internet Explorer, Google Chrome, and Visual Studio 2013. However, Git for Windows (git.exe) uses OpenSSL for its crypto stack, and the Git for Windows distribution includes a set of trusted root certificates in a simple text file. Your organization&rsquo;s root certificate will not be in this list, and if you try to use git.exe to perform network operations against your TFS server, you&rsquo;ll get an error like this:</p>
<p><span style="font-family: 'Courier New'; font-size: x-small;">F:\&gt;git clone https://myserver/tfs/DefaultCollection/_git/Proj <br /> Cloning into 'Proj'... <br /> fatal: unable to access 'https://myserver/tfs/DefaultCollection/_git/Proj/': SSL certificate problem: unable to get local issuer certificate</span></p>
<p>You have a couple of different options for how to work around this problem. The easy way is to just disable SSL certificate validation entirely &ndash; if this is what you want to do, you can find numerous articles on the web about how to do this. I won&rsquo;t address it here because unfortunately, it defeats one of the purposes of having SSL to begin with &ndash; server authentication. Your organization probably has HTTPS turned on for a reason. What if we wanted to add the root certificate to git.exe&rsquo;s certificate store, in the same way that domain membership in your organization has added it to your Windows certificate store? Here&rsquo;s how.</p>
<h3>Step 1. Extract the root certificate as a base64-encoded X.509 CER/PEM file</h3>
<p>(These steps were written using Internet Explorer 11. On other versions of IE, I suspect the same steps are still possible, but they may be slightly different.) Open Internet Explorer and visit your TFS server in the web browser. For our example above, the URI would be <a href="https://myserver/tfs">https://myserver/tfs</a>. At the right of the address bar is a lock icon which you can click to learn more about the details of how your connection to the server has been secured.</p>
<p>At the bottom of the drop-down is a link to &ldquo;View certificates.&rdquo; If you click the &ldquo;Certification Path&rdquo; tab of the dialog box which comes up, you can see the entire chain of trust. Select the top-most certificate in the chain &ndash; this is the root certificate.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/8877.cert1_112B2C54.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/8877.cert1_5F00_112B2C54.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="cert1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/7416.cert1_thumb_0C487898.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/7416.cert1_5F00_thumb_5F00_0C487898.png" alt="cert1" width="298" height="370" border="0" /></a></p>
<p>Then click &ldquo;View Certificate&rdquo; to open up that root certificate, and go to the Details tab.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/4111.cert2_479BDE56.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/4111.cert2_5F00_479BDE56.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="cert2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/4201.cert2_thumb_10C18A10.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/4201.cert2_5F00_thumb_5F00_10C18A10.png" alt="cert2" width="298" height="370" border="0" /></a></p>
<p>On the Details tab, you can select &ldquo;Copy to File&hellip;&rdquo;, which will start the export wizard for certificates. On the second page of the wizard, you will be asked what format to use for exporting your certificate. Choose the second option: base64 encoded X.509.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/0827.cert3_59E735C9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/0827.cert3_5F00_59E735C9.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="cert3" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/2844.cert3_thumb_1BEDA50B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/2844.cert3_5F00_thumb_5F00_1BEDA50B.png" alt="cert3" width="418" height="408" border="0" /></a></p>
<p>Save the certificate somewhere on your disk. You&rsquo;ll need this for step 2.</p>
<h3>Step 2. Switch to using a private copy of the Git root certificate store</h3>
<p>When you install Git for Windows (msysgit) on your machine, it drops a file called curl-ca-bundle.crt in your Program Files directory. This is the root certificate store for git.exe. It&rsquo;s just a text file containing all of the certificates that git.exe trusts, one after another. The text file has UNIX (\n) line endings, though, so if you open it up in Notepad, it won&rsquo;t look too pretty.</p>
<p>What we want to do in this step is to make a copy of the curl-ca-bundle.crt file (which is installed on a per-machine basis) that will be private for just your Windows user. The ideal place to store the file is in your %USERPROFILE% (C:\Users\yourname) directory, right alongside your per-user (&ldquo;global&rdquo;) .gitconfig file. On my machine, the following command does it &ndash; if you are using 32-bit Windows, you&rsquo;ll want to fix up the Program Files part of the path so there isn&rsquo;t an &ldquo;x86&rdquo; section.</p>
<p>(If you don&rsquo;t know where your user profile directory is, you can just run &ldquo;echo %USERPROFILE%&rdquo; at the command prompt. For example, mine is C:\Users\phkelley.)</p>
<p><span style="font-size: x-small;"><span style="font-family: 'Courier New';">copy "C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt" C:\Users\<strong>yourname</strong></span></span></p>
<p><strong>(Note: </strong>In the Git for Windows 2.x series, the path has changed to&nbsp;<span>C:\Program Files (x86)\Git\mingw32\ssl\certs\ca-bundle.crt. Thanks Craig for the tip.)</span></p>
<p>Next, we&rsquo;ll want to configure Git to use this private copy of the certificate store. You can set this up with the following command:</p>
<p><span style="font-family: 'Courier New'; font-size: x-small;">git config --global http.sslCAInfo C:/Users/<strong>yourname/</strong>curl-ca-bundle.crt</span></p>
<p>(Note the use of forward slashes and not backslashes above.) As a quick sanity check, try to clone a repository from GitHub to make sure that everything is still working:</p>
<p><span style="font-family: 'Courier New'; font-size: x-small;">git clone https://github.com/libgit2/EmptyGitRepository</span></p>
<h3>Step 3. Add the exported root certificate to the private copy of the store</h3>
<p>The last step is to open up the curl-ca-bundle.crt file (the private copy we made in step 2) in a text editor and add an entry at the bottom for your exported root certificate. I used the <a href="https://www.efgh.com/software/unix2dos.htm">&ldquo;unix2dos&rdquo; tool available here</a> to change the line endings in the file from \n to \r\n so that I could open the file up in Notepad:</p>
<p><span style="font-family: 'Courier New'; font-size: x-small;">unix2dos C:\Users\<strong>yourname</strong>\curl-ca-bundle.crt</span></p>
<p>Then I opened up the exported certificate from step 1 in Notepad and put its entire contents onto the clipboard.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/2870.cert4_56D4D7D4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/2870.cert4_5F00_56D4D7D4.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="cert4" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/6521.cert4_thumb_1B17CFD2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/6521.cert4_5F00_thumb_5F00_1B17CFD2.png" alt="cert4" width="341" height="415" border="0" /></a></p>
<p>Next, I opened up the C:\Users\<strong>yourname</strong>\curl-ca-bundle.crt file, added an entry for this certificate at the end, pasted in the cert, and saved the file. All done!</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/5481.image_4A69455C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/5481.image_5F00_4A69455C.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/6428.image_thumb_47C31A5C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/6428.image_5F00_thumb_5F00_47C31A5C.png" alt="image" width="388" height="531" border="0" /></a></p>
<h3>Step 4. Try it out&hellip;</h3>
<p><span style="font-family: 'Courier New'; font-size: x-small;">F:\&gt;git clone https://myserver/tfs/DefaultCollection/_git/Proj <br />Username for 'https://myserver': domain\username <br /> Password for 'https://domain\username@myserver': <br /> remote: <br /> remote:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fTfs <br /> remote:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fSSSSSSSs <br /> remote:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fSSSSSSSSSS <br /> remote: TSSf&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fSSSSSSSSSSSS <br /> remote: SSSSSF&nbsp;&nbsp;&nbsp;&nbsp; fSSSSSSST SSSSS <br /> remote: SSfSSSSSsfSSSSSSSt&nbsp;&nbsp; SSSSS <br /> remote: SS&nbsp; tSSSSSSSSSs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SSSSS <br /> remote: SS&nbsp;&nbsp; fSSSSSSST&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SSSSS <br /> remote: SS fSSSSSFSSSSSSf&nbsp;&nbsp;&nbsp; SSSSS <br /> remote: SSSSSST&nbsp;&nbsp;&nbsp; FSSSSSSFt SSSSS <br /> remote: SSSSt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSSSSSSSSSSSS <br /> remote:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSSSSSSSSSS <br /> remote:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSSSSSSs <br /> remote:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FSFs&nbsp;&nbsp;&nbsp; (TM) <br /> remote: <br /> remote:&nbsp; Microsoft (R) Visual Studio (R) Team Foundation Server <br /> remote: <br /> Receiving objects: 100% (6781/6781), 47.12 MiB | 32.56 MiB/s, done. <br /> Resolving deltas: 100% (4553/4553), done. <br /> Checking connectivity... done</span></p>
<p>Not bad! The steps above for adding a root certificate apply to anyone using git.exe in corporate/self-signed scenarios like this, not just Team Foundation Server 2013 or later.</p>]]></content:encoded>
    </item>
    <item>
      <title>Git network operations in Visual Studio 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/git-network-operations-in-visual-studio-2013</link>
      <pubDate>Sun, 20 Oct 2013 10:49:59 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2013/10/20/git-network-operations-in-visual-studio-2013/</guid>
      <description><![CDATA[Visual Studio 2013 includes in-the-box support for Git version control. That support includes the...]]></description>
      <content:encoded><![CDATA[<p>Visual Studio 2013 includes in-the-box support for Git version control. That support includes the ability to perform Git network operations from inside of Visual Studio, such as cloning a repository, or performing a fetch, push, or pull operation on an existing repository.</p>  <p>An endpoint for a clone, fetch, push, or pull operation in Git is called a “remote.” Visual Studio 2013’s Git support contains support for remotes using the following protocols.</p>  <ul>   <li>HTTP (i.e. <a href="https://github.com/libgit2/TestGitRepository">https://github.com/libgit2/TestGitRepository</a>, or <a href="https://yourname.visualstudio.com/DefaultCollection/_git/YourRepo">https://yourname.visualstudio.com/DefaultCollection/_git/YourRepo</a>)</li>    <li>File paths (i.e. F:\myrepo.git, or <a href="file://\\servername\sharename\myrepo.git">\\servername\sharename\myrepo.git</a>)</li>    <li>git:// URIs</li> </ul>  <p>As of this writing, Visual Studio 2013 does not have support for ssh-based remotes. If you have a Git remote that uses SSH and you try to perform a network operation in Visual Studio, you’ll get the message “This transport isn’t implemented. Sorry.” (This message comes from the libgit2 library.) I don’t have a timeline for when support for SSH remotes might be implemented in Visual Studio.</p>  <h3>HTTP endpoints</h3>  <p>When performing network traffic against an HTTP endpoint, Visual Studio uses the System.Net stack (HttpWebRequest and friends) to actually issue the web requests. Both HTTP and HTTPS URIs are supported.</p>  <p>The System.Net stack in the .NET framework has full support for web proxy configuration through the Internet Options page. If you need to use a web proxy to communicate with your remote endpoint, you should set up your proxy configuration there. Start the Control Panel, then select Internet Options to open the Internet Properties dialog. On the Connections tab, at the bottom of the page is a button labeled “LAN settings.” Clicking this button opens the proxy configuration dialog for Internet Explorer.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/5557.proxy_config_2D75A67F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/5557.proxy_5F00_config_5F00_2D75A67F.png"><img title="proxy_config" style="border: 0px currentcolor; margin-right: auto; margin-left: auto; float: none; display: block;" border="0" alt="proxy_config" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/7711.proxy_config_thumb_61A9CFC5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/7711.proxy_5F00_config_5F00_thumb_5F00_61A9CFC5.png" width="394" height="346" /></a></p>  <p>The System.Net stack also includes support for proxy authentication (HTTP status code 407), if your environment requires it.</p>  <h3>Special considerations for HTTPS endpoints</h3>  <p>If an HTTPS URI is used for a remote, the Windows certificate store is used to validate the server’s SSL certificate.</p>  <p>If the server to which you are pushing/pulling has a self-signed certificate, then as of this writing, we give an unfortunate and vague error message to the user. “An error occurred while sending the request” is what is commonly seen. You should use the Windows certificate manager (certmgr.msc) to add the self-signed certificate (or the authority at the top of the certificate’s chain) to the Windows certificate store as a trusted certificate, and then try your network operation again. We hope to improve on this user experience in a future release, because it is very hard to make the mental jump here from “an error occurred” to “oh, I need to add the certificate to my certificate store.”</p>  <p>Visual Studio 2013 also supports the use of client certificates as part of the SSL negotiation, if the server requires it. Certificate selection is automatic, by default. If you need to use a specific client certificate to prove your identity to the server, you can use the command-line “<a href="https://msdn.microsoft.com/en-us/library/ee349260.aspx">tf certificates</a>” command to select which client certificates are eligible for presentation.</p>  <h3>Authentication</h3>  <p>When using HTTP to communicate with a remote, Visual Studio may be required to authenticate with the remote server. Visual Studio 2013 supports 3 methods of authentication when communicating with a Git server over HTTP.</p>  <ul>   <li>Basic authentication</li>    <li>Integrated Windows authentication</li>    <li>Team Foundation Service federated authentication (used only when communicating with endpoints at <a href="https://*.visualstudio.com/">https://*.visualstudio.com/</a>)&#160;&#160;&#160; </li> </ul>  <p>Each authentication method has its own credentials acquisition dialog.</p>  <h3>Basic authentication</h3>  <p>If you are communicating with a third-party Git hosting service like Github or Bitbucket, you will probably be using Basic authentication to send your password in cleartext inside the SSL tunnel. Visual Studio 2013 is able to store and retrieve basic auth credentials from the Windows credentials vault using the same protocol as the <a href="https://gitcredentialstore.codeplex.com/">Windows Credential Store for Git</a>. If you have this plug-in for Git for Windows installed, then once you save your credentials once, you should be able to use both git.exe and Visual Studio to perform network operations without any password prompts.</p>  <p>If you ever want to clear the password from storage, you can use the Credential Manager in the Control Panel to remove it, or use cmdkey.exe from the command line.</p>  <h3>Windows authentication</h3>  <p>If you are using an on-premises Team Foundation Server 2013 server to host your Git repository, then you probably authenticate to it with integrated Windows authentication. If you are logged on with your domain account, authentication from Visual Studio should be transparent.</p>  <p>However, git.exe (which uses CURL for its transport layer) will not be able to retrieve your credentials transparently. You can either type your DOMAIN\username and password strings when you push/pull, or you can install the <a href="https://gitcredentialstore.codeplex.com/">Windows Credential Store for Git</a> and persist your credentials for git.exe’s use.</p>  <p>Most customers do not use HTTPS to secure their Team Foundation Server 2013 server on their intranet. However, if your organization does use HTTPS, and has its own certificate infrastructure used to sign the certificate for the Team Foundation Server 2013 deployment, then you may find git.exe fails to validate the SSL certificate. This is because the root certificate for your organization’s certificate infrastructure is pushed to your machine’s Windows certificate store through Active Directory, but git.exe cannot see it. Git for Windows uses OpenSSL for its certificate store and the set of certificates comes with the Git for Windows package. You can disable SSL verification for git.exe through your .gitconfig file, or use the <a href="https://www.kernel.org/pub/software/scm/git/docs/git-config.html">http.sslCAInfo and http.sslCAPath configuration options</a> to help Git for Windows find the certificate at the root of the certification chain for your TFS 2013 deployment.</p>  <h3>Federated authentication</h3>  <p>This authentication mechanism is used only by the Team Foundation Service (<a href="https://*.visualstudio.com/">https://*.visualstudio.com/</a>) and is based on Windows Live ID. If you have already logged into your Team Foundation Service account using the Team Explorer, you should find that authentication for push, pull, clone, and fetch operations is transparent.</p>  <p>The command-line Git for Windows executable, git.exe, does not support this authentication method. If you want to perform network operations against a Team Foundation Service-based Git repository using git.exe, you will need to <a href="https://tfs.visualstudio.com/en-us/news/2012-aug-27.aspx">provision a basic authentication username and password</a> using the Edit Profile dialog in the Team Foundation Service web interface. You can then use that basic auth username and password from the command line. (Visual Studio will still prefer to authenticate using federated authentication.)</p>]]></content:encoded>
    </item>
    <item>
      <title>Checkin policy multitargeting</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/checkin-policy-multitargeting</link>
      <pubDate>Mon, 12 Aug 2013 14:46:27 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2013/08/12/checkin-policy-multitargeting/</guid>
      <description><![CDATA[Updated 27 August 2015: The provided solution now supports multi-targeting to Visual Studio 2015 as...]]></description>
      <content:encoded><![CDATA[<p><span style="text-decoration: underline;"><strong>Updated 27 August 2015: The provided solution now supports multi-targeting to Visual Studio 2015 as well!</strong></span></p>
<p>With each major release of Visual Studio, customers find that they have to re-build their check-in policies for TFS version control to target the new version of the client object model. As the pace of Visual Studio major releases has quickened (there will be both a Visual Studio 2012 and a Visual Studio 2013!) customers have been experiencing this pain more often. We also often receive questions about how to manage deployment of check-in policies in mixed environments, where some users have Visual Studio 2010, and some have Visual Studio 2012, but both versions of Visual Studio need to use a custom check-in policy developed in-house.</p>
<h4>Example multitargeted checkin policy solution</h4>
<p>Today we are releasing an example solution which demonstrates two nifty things:</p>
<ol>
<li>How to use a single code base for your custom check-in policy, but build that check-in policy for Visual Studio 2010, 2012, and 2013 simultaneously.</li>
<li>How to deploy your check-in policies to customers using VSIX packages, which are easy to install.</li>
</ol>
<p><strong>You can download the solution from </strong><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/8272.MultitargetedCheckinPolicy_2015.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68/8272.MultitargetedCheckinPolicy_5F00_2015.zip"><strong>here</strong></a><strong>. (Updated 27 August 2015)</strong></p>
<h4>How does it work?</h4>
<p>You can open this solution in VS 2010, VS 2012, or VS 2013. In the toolbar of Visual Studio you will see a Configuration drop-down that allows you to select what &ldquo;target&rdquo; version of the TFS Version Control client object model to use for the build &ndash; 2010, 2012, or 2013. When you say Build, the appropriate version of the client object model is used to create a check-in policy DLL. So if you selected VS2012_Release, then you would get a DLL in the bin\VS2012_Release directory that is suitable for installation on VS 2012 clients.</p>
<p>If you have the Visual Studio SDK installed for whatever version of Visual Studio you&rsquo;re using, then the solution will automatically detect this, and in addition to the DLL in the bin\VS2012_Release folder, you get a VSIX you can distribute to your clients to install on their machines. If you don&rsquo;t have the Visual Studio SDK installed, we notify you with a build warning: &ldquo;<em>The Visual Studio SDK is not installed, so no VSIX installer package can be generated.</em>&rdquo; The Visual Studio SDK is a free download &ndash; it&rsquo;s about 10 megabytes and is specific to each version of Visual Studio. (Be careful when getting it for VS 2010 &ndash; if you have Service Pack 1 installed, then you need to make sure to get the &ldquo;VS 2010 SP1 SDK&rdquo; which is a <a href="https://www.microsoft.com/en-us/download/details.aspx?id=21835">different download</a>.)</p>
<p>If you have a fully mixed environment, and you want to build your custom check-in policy for VS 2010, VS 2012, and VS 2013, then you&rsquo;ll need a machine with all three of those Visual Studio versions installed side-by-side, and you&rsquo;ll need the Visual Studio SDK installed for each one. Then when you&rsquo;re ready to produce a VSIX installer for your clients, open the solution in each Visual Studio version one at a time. Make sure that the appropriate Configuration is selected in the toolbar (VS2010_Release for VS 2010, VS2012_Release for VS 2012, etc.) and do a build. At the end of the process, in your bin directory, you&rsquo;ll have three VSIX installers &ndash; one for each version of Visual Studio. Distribute these installers to your users so that they can install the check-in policy. VS 2010 users get the VS 2010 VSIX, VS 2012 users get the VS 2012 VSIX, and so on.</p>
<h4>How do I adapt the solution to my existing custom check-in policy&rsquo;s codebase?</h4>
<p>You&rsquo;ll probably want to start by doing a giant search-and-replace on the strings ExampleMultitargetedCheckinPolicy and MultitargetedCheckinPolicy to replace them with your check-in policy name and namespace. Don&rsquo;t be afraid to open up the .csproj file in Notepad to make changes to it.</p>
<p>Also, be sure to update the VSIXMANIFEST files so that your VSIX extension gets the right company name, new GUIDs, and your own description of the check-in policy. The PKGDEF file contains the registry entries that are added by the VSIX that allow the check-in policy to be discovered by Visual Studio, so it should be updated too, to reflect the new namespace and name of your check-in policy, and the name of the DLL file your solution is producing.</p>
<h4>Downsides to VSIX deployment</h4>
<p>One downside of VSIX deployment of check-in policies is that they are not visible outside of Visual Studio. If you&rsquo;re using the TF.exe command line, Git-TFS, or the Windows Explorer shell extension for TFS, then the check-in policy will not be available in those environments, and you&rsquo;ll have to override it in order to check in. If you need the check-in policy available in these environments, VSIX deployment is not for you, and you should deploy your check-in policy via the traditional method:</p>
<ol>
<li>Put the DLL file for the check-in policy somewhere on disk</li>
<li>Add a registry value of type REG_SZ to &ldquo;HKLM\SOFTWARE\Microsoft\VisualStudio\[version]\TeamFoundation\SourceControl\Checkin Policies&rdquo; that points to the check-in policy DLL</li>
<li>(<a href="https://blogs.msdn.com/b/dsvst/archive/2012/10/08/your-vs-package-may-not-load-after-porting-it-to-vs-2012.aspx">VS 2012 and later only</a>) Run devenv /setup from an elevated command prompt so that the check-in policy is visible to Visual Studio</li>
</ol>
<p>If you&rsquo;re not going to use VSIX deployment, then you don&rsquo;t need the Visual Studio SDK installed, and you can just ignore the build warning that says the VSIX installer is not being generated.</p>]]></content:encoded>
    </item>
    <item>
      <title>TF400030: The local data store is currently in use by another operation.</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/tf400030-the-local-data-store-is-currently-in-use-by-another-operation</link>
      <pubDate>Fri, 31 May 2013 07:00:00 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2013/05/31/tf400030-the-local-data-store-is-currently-in-use-by-another-operation/</guid>
      <description><![CDATA[This is an error which can occur when using local workspaces in Visual Studio 2012 or later. The...]]></description>
      <content:encoded><![CDATA[<p>This is an error which can occur when using <a href="https://blogs.msdn.com/b/phkelley/archive/2013/05/29/server-workspaces-vs-local-workspaces.aspx">local workspaces</a> in Visual Studio 2012 or later. The full text of the message in English is actually “TF400030: The local data store is currently in use by another operation. Please wait and then try your operation again. If this error persists, restart the application.”.</p>  <h5>What causes this error?</h5>  <p>As mentioned in a <a href="https://blogs.msdn.com/b/phkelley/archive/2013/05/29/server-workspaces-vs-local-workspaces.aspx">previous blog post</a>, local workspaces keep certain pieces of data for your workspace on your local machine. With server workspaces, these data are kept on the server. These local pieces of data include your working folders (mappings), your local version table, and your pending changes.</p>  <p>Under our current architecture, only a single operation (thread) can use this local data at a time. If two pieces of system want to use the data store simultaneously – perhaps the Solution Explorer and the Source Control Explorer both want to refresh after an Undo operation was performed – then these two components have to take turns to use the local data store. One will wait for the other to finish, and who gets to go first is arbitrary.</p>  <p>The ‘loser’ of the race has to wait before proceeding, but will only wait for about 45 seconds. If he ends up waiting for that full amount of time, but still doesn’t get the chance to use the local data store (because some other component of the system is still using it), then this error will be raised.</p>  <p>Depending on the scenario in which the error was raised, it may be benign. In the example I described, where two components of the system are both trying to refresh simultaneously, and one fails with a TF400030 timeout error, then it’s possible to manually refresh (F5) the offending component and move on with your work.</p>  <p>However, it’s also possible for this error to pop up during an operation you care more deeply about, like a check-in, or a merge, or an undo operation. In these cases seeing this error may be more of a real problem than a minor annoyance.</p>  <h5>45 seconds is a long time. What’s taking so long?</h5>  <p>There are 3 main possibilities.</p>  <p>The first possibility is that the ‘<strong>scanner</strong>’ is doing a full scan of the workspace to detect pending edits. This involves looking at the file attributes of each item in the workspace and comparing its size and last-modified time to our previously-observed values in the local version table. This scanner is what enables local workspaces to detect edits created just by opening up a file in Notepad and saving it to disk without ever telling TFS. Full scans are infrequent, but they always happen at application startup, and they may happen again later if a flood of changes comes in and overwhelms our notification-based ‘partial scanner’, causing a full invalidation.</p>  <p>The cost of scanning the disk is proportional to the number of items in the workspace, and is strongly affected by whether or not the operating system’s disk cache is hot or cold. A cold full scan (for example, after you reboot your machine) is much more expensive because actual I/O has to be performed to get the file attributes of each item in the workspace. Cold full scan performance is strongly affected by the performance of your I/O subsystem – SSDs are dramatically faster at random I/O than mechanical disks.</p>  <p>The second possibility is that the user is performing a ‘<strong>reconciled</strong>’ operation on the server. Since the client’s copy of the working folders, local version table, and pending changes are authoritative, when performing a server-side operation like check-in, shelve, or merge, the server’s copy of this data must first be synchronized with the client’s. Our synchronization protocol is incremental and efficient for working folders and the local version table, but to assure absolute correctness, we copy the entire pending changes table up to the server if any change has occurred since the last reconciled operation.</p>  <p>The cost of reconciling is therefore proportional to the number of pending changes in the workspace, and is strongly affected by the bandwidth of your connection to the TFS server and the performance of that TFS server – the speed at which it can complete the reconcile.</p>  <p>A third possibility for a slowdown is a <strong>deadlock</strong> between two operations – such a deadlock would not be related to the number of items in the workspace, and would be highly-scenario specific. Such issues are bugs. We fixed a couple of deadlock scenarios in Visual Studio 2012 Update 2, especially related to installing and uninstalling NuGet packages.</p>  <h5>How can I reduce the frequency of this error or avoid it entirely?</h5>  <p>First, please ensure that your copy of Visual Studio 2012 is updated to Update 2 or later. This ensures that you are protected from the deadlock scenarios described above.</p>  <p>Second, try to avoid working with extremely large sets of pending changes (10,000+) for a long time without checking in. This helps to keep ‘reconcile’ costs low.</p>  <p>Third, and this is probably the most important point to look at – keep the <strong>size of your workspace</strong> from growing too large. For Visual Studio 2012, we are recommending that local workspaces have 50,000 or fewer items. (‘Items’ means both files and folders.) The actual enforced limits are much higher (500,000 items) but as you increase the size of your workspace, the risk of seeing TF400030 errors increases as it takes longer for the scanner to complete a full scan.</p>  <p>Fourth, the problem is exacerbated by having multiple instances of Visual Studio 2012 open at the same time, especially if they have the Source Control Explorer open. Refreshing the Source Control Explorer is an operation which requires reconciling with the server – if you make a change in one instance of Visual Studio, all other instances are notified of the change and refresh themselves. This increases contention for the local data store.</p>  <p>Lastly – if you have exhausted all options and find you are still receiving the TF400030 error, you can switch your workspace from “local” to “server” in the Edit Workspace dialog. It is not possible to get a TF400030 error when working with a server workspace.</p>  <h5>How can I find out how many items I have in my workspace?</h5>  <p>Measuring this is made more complicated than it could be because of the backup copies of each file that we keep to support offline diff and offline undo.</p>  <p>Most workspaces are singly-rooted – that is to say, there is some local folder C:\MyWorkspace where everything is underneath that path. If you right-click on that path in Windows Explorer (now called the File Explorer) and go to Properties on that folder, you should be able to see the total number of items in that folder (recursively). This count ends up double-counting files, though, because the backup copies in our hidden $tf folder are being counted twice!</p>  <p>A slightly more accurate measure is to turn on the ability to see hidden files and folders, and then run the same Properties command in the File Explorer on the C:\MyWorkspace\$tf folder. This won’t count folders, so we’re undercounting slightly, but it should be clear whether you are greatly exceeding the recommendation of 50,000 items, or whether you’re generally in compliance with the recommendation. (The recommendation of 50,000 items is fairly conservative.)</p>  <h5>I’m over the recommended limit - how do I reduce my item count?</h5>  <p>Often customers have more than one branch of their source code mapped in the same workspace. There is some guidance <a href="https://blogs.msdn.com/b/phkelley/archive/2013/05/30/using-multiple-workspaces-with-visual-studio.aspx">here</a> for how to start using multiple workspaces – one for each branch.</p>  <p>Some customers, though, will find that their codebase is simply too large for local workspaces. In this case we recommend that you switch from local workspaces to our more traditional ‘server workspaces,’ which are proven to scale to up to 10,000,000 items in a single workspace (given appropriate server hardware).</p>  <h5>What is Microsoft doing to make this better in the future?</h5>  <p>We are planning to include, in the next major version of Visual Studio, a built-in feedback mechanism that warns you when you greatly exceed the recommendation for the number of items in a local workspace.</p>  <p>The next major version of Visual Studio also includes significant performance enhancements for the ‘scanner’ component. The performance improvements are not algorithmic, but are rather the result of careful performance (and memory allocation) tuning and profiling. The performance improvement in the next release of Visual Studio for the scanner, at scale, is about a factor of two. As a result we will likely be adjusting our guidance for the number of items in a local workspace upward from 50,000 to some larger number for the next release of Visual Studio.</p>]]></content:encoded>
    </item>
    <item>
      <title>Using multiple workspaces with Visual Studio</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/using-multiple-workspaces-with-visual-studio</link>
      <pubDate>Thu, 30 May 2013 05:02:04 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2013/05/30/using-multiple-workspaces-with-visual-studio/</guid>
      <description><![CDATA[The past couple of posts I’ve made focus on workspaces and the differences between server and local...]]></description>
      <content:encoded><![CDATA[<p>The past couple of posts I’ve made focus on <a href="https://blogs.msdn.com/b/phkelley/archive/2013/05/28/workspaces.aspx">workspaces</a> and the differences between <a href="https://blogs.msdn.com/b/phkelley/archive/2013/05/29/server-workspaces-vs-local-workspaces.aspx">server and local workspaces</a>. Visual Studio and TFS version control are designed to support the use of multiple workspaces on the same machine, but many customers use only one workspace. Depending on your situation, you might be missing out on a better user experience by limiting yourself to just one workspace!</p>  <h5>The Manage Workspaces dialog</h5>  <p>Let’s look first at the <strong>Manage Workspaces</strong> dialog, which is used to look at all the workspaces on the current machine.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/8420.image_239F0F55.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/8420.image_5F00_239F0F55.png"><img title="image" style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/4137.image_thumb_34A33D38.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/4137.image_5F00_thumb_5F00_34A33D38.png" width="449" height="334" /></a></p>  <p>The Manage Workspaces dialog can be accessed through the following methods.</p>  <ol>   <li>File menu –&gt; Source Control submenu –&gt; Advanced –&gt; Workspaces…</li>    <li>Launch the Source Control Explorer. On the toolbar, there is a “Workspace:” combo box. Open the combo box and select “Workspaces…”.</li>    <li>(In Visual Studio 2012 and later.) Open the Pending Changes Page in the Team Explorer. From the Actions menu, select “Manage Workspaces.”</li> </ol>  <p>The Manage Workspaces dialog shows, by default, those workspaces on the local computer to which you have access. Most of the time that means that the workspaces belong to you. But if you’re on a shared machine and someone has created a public or public-limited workspace, then those workspaces will show up in this list as well.</p>  <p>You can check the “<strong>Show remote workspaces</strong>” checkbox at the bottom to refresh the list of workspaces and have it show instead all workspaces, on any machine, where you are the owner of the workspace.</p>  <p>From this dialog box, you can add new workspaces, delete existing workspaces, or edit workspaces you already have to change their properties. The properties which you can change are summarized in a previous <a href="https://blogs.msdn.com/b/phkelley/archive/2013/05/28/workspaces.aspx">blog post on workspaces</a>.</p>  <h5>Switching between workspaces</h5>  <p>You may recall that each workspace has its own set of working folders (also called mappings) and pending changes. The Source Control Explorer and Pending Changes Page in the Team Explorer each allow you to switch between workspaces so that you can see and manipulate the pending changes in each workspace. (In Visual Studio 2010 and earlier, the Pending Changes toolwindow also allows you to switch between workspaces.)</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/8666.image_48BC59C1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/8666.image_5F00_48BC59C1.png"><img title="image" style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/3007.image_thumb_081A0D52.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/3007.image_5F00_thumb_5F00_081A0D52.png" width="701" height="152" /></a></p>  <p>This screenshot shows the controls which allow you to select your workspace in the Source Control Explorer and in the Pending Changes Page of the Team Explorer. All the workspaces on the local machine to which you have access are available in either drop-down.</p>  <p>When you select a different workspace, you may notice that the Source Control Explorer’s left and right panes have some items change from grey to black, or black to grey. This is because the workspace you switched to may be mapping more items, fewer items, or an entirely different set of items with its working folders. The Local Path hyperlinks above the right pane may change accordingly as well.</p>  <p>In the Team Explorer’s Pending Changes Page, when you select a different workspace, the set of pending changes, your pending check-in comment, associated work items, etc. will all switch as well. Everything is preserved; you can toggle right back when you want to. Keep in mind, though, that a solution cannot span multiple workspaces and is always ‘in’ a particular workspace.</p>  <h5>Scenarios for using multiple workspaces</h5>  <p>Many customers using TFS version control use branching and merging to control code movement and perform servicing on existing releases. For example, there might be a Main branch located at $/Project/Main, and several branches for different releases also located underneath $/Project, such as $/Project/Release1, $/Project/Release2. Often there is also a development branch called $/Project/Development.</p>  <p>Customers commonly create just one workspace on your machine that maps $/Project to a location on disk like C:\Project. In the example described above, that results in all four branches coming down to the local disk in the same folder. The engineer who does this might be working almost exclusively in the Development branch, and they end up having 4 times as much source code downloaded to their machine. If they end up having to make a change in the Release2 branch to fix a production issue, they will find their pending changes for Development ‘mixed in’ with their Release2 changes.</p>  <p>It’s much less error-prone to compartmentalize the branches by creating one workspace for every branch. In this particular scenario the customer might create four workspaces, instead:</p>  <table cellspacing="0" cellpadding="2" width="502" border="1"><tbody>     <tr>       <td valign="top" width="201">         <blockquote style="margin-right: 0px;" dir="ltr">           <p align="left"><strong>Workspace name</strong></p>         </blockquote>       </td>        <td valign="top" width="299">         <blockquote style="margin-right: 0px;" dir="ltr">           <p><strong>Mappings</strong></p>         </blockquote>       </td>     </tr>      <tr>       <td valign="top" width="202">PHKELLEY-DEV_Main</td>        <td valign="top" width="299">$/Project/Main –&gt; C:\Project\Main</td>     </tr>      <tr>       <td valign="top" width="202">PHKELLEY-DEV_Release1</td>        <td valign="top" width="299">$/Project/Release1 –&gt; C:\Project\Release1</td>     </tr>      <tr>       <td valign="top" width="202">PHKELLEY-DEV_Release2</td>        <td valign="top" width="299">$/Project/Release2 –&gt; C:\Project\Release2</td>     </tr>      <tr>       <td valign="top" width="202">PHKELLEY-DEV_Development</td>        <td valign="top" width="299">$/Project/Development –&gt; C:\Project\Development</td>     </tr>   </tbody></table>  <p>This allows work to go on in each branch separately. If you are in the middle of a change in Development but are interrupted and have to make a change in Release2, then just close your copy of the solution from the Development branch and open your copy from the Release2 branch. This action will automatically switch the Pending Changes Page and Source Control Explorer’s workspaces to match the solution’s workspace. All your work from Development is still there and untouched; you can use the Release2 workspace to commit your change there, and then switch back to Development just as easily as you switched to Release2.</p>  <h5>Performing integrations</h5>  <p>Some customers have mentioned that the reason they map all their branches in the same workspace is to perform integrations (merges) from branch to branch. You can still merge when using multiple workspaces described above. You always want to be performing the merge in the target branch – if I’m integrating from Development to Main, then the workspace selected should be PHKELLEY-DEV_Main, since that’s where changes are being pended and that’s the branch to be modified with a check-in. The source branch doesn’t have to be mapped in the same workspace (or mapped at all!).</p>  <h5>Performance benefits</h5>  <p>If you’re using <a href="https://blogs.msdn.com/b/phkelley/archive/2013/05/29/server-workspaces-vs-local-workspaces.aspx">local workspaces</a>, then you can see some performance benefits by switching to using “one branch == one workspace”. Local workspaces are intended for customers with small to medium size projects where the workspace has 50,000 or fewer items. I have seen customers where each branch of their source code is well within our scalability target for local workspaces – but the customer has placed several branches of source code all in the same workspace. The total number of items then ends up being far beyond 50,000, and performance suffers or “TF400030: The local data store is currently in use by another operation” errors are observed. Simply separating out the branches with a “one branch, one workspace” philosophy brings them back within the scalability target and they end up being much happier.</p>]]></content:encoded>
    </item>
    <item>
      <title>Server workspaces vs. local workspaces</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/server-workspaces-vs-local-workspaces</link>
      <pubDate>Tue, 28 May 2013 18:49:49 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2013/05/28/server-workspaces-vs-local-workspaces/</guid>
      <description><![CDATA[TFS 2012 and VS 2012 feature a new kind of workspace called “local” workspaces. We continue to fully...]]></description>
      <content:encoded><![CDATA[<p>TFS 2012 and VS 2012 feature a new kind of workspace called “local” workspaces. We continue to fully support the older kind of workspaces (from VS/TFS 2005 - 2010), but we now call these “server” workspaces. In the VS/TFS 2005 - 2010 documentation there is no mention of these workspaces ever being called “server workspaces” – because before the existence of local workspaces, there was no need to have a special name for them! They were just “workspaces.”</p>  <p>You might be asking, “What are the differences between local and server workspaces, and where do these two names come from?”</p>  <h5>Offline support</h5>  <p>If your workspace is a “local workspace,” several key data structures have been moved from the TFS server onto the TFS client. Thus the name “local” – the data structures are local to your machine instead of being hosted for you by the TFS server. Putting these data structures on your local machine gives VS 2012 the ability to perform a number of source control operations without ever calling the TFS server. These operations continue to work when your machine is disconnected from the TFS server.</p>  <ul>   <li>Opening a source-controlled solution</li>    <li>Checking out a file for edit</li>    <li>Pending a new file or folder for add</li>    <li>Pending a delete on an existing file or folder</li>    <li>Pending a rename on an existing file or folder</li>    <li>Asking “what are the pending changes in this workspace?”</li>    <li>Undoing pending changes</li>    <li>Diffing your copy of a file with the version of the file your change is pended against</li> </ul>  <p>With a server workspace, all of these operations require a connection to the TFS server. And even with a local workspace, most other operations, such as using the Source Control Explorer, viewing the history of an item, checking in, shelving/unshelving, branching/merging, undeleting items, etc. still require you to have a connection to TFS. But the set of operations which are available offline is actually quite substantial, and frees you up to be able to get some done on an airplane or a train, for example, where a connection to your TFS server or the Team Foundation Service might not be available.</p>  <h5>No read-only bit</h5>  <p>When using server workspaces (the traditional kind of workspace), every file in the workspace’s working copy that is not checked out for edit/add has the +R bit set. If you want to edit the file, you have to check it out first. In Visual Studio, this is seamless, because typing in the editor automatically checks out the file. (You may experience a slight pause as you type the first character in the document.) The process of checking out the file removes the +R bit and enables you to save your changes to the file to disk.</p>  <p>With local workspaces, this restriction is relaxed. The +R bit is never set on items in your working copy (unless you set it manually!). When Visual Studio asks the TFS version control system “what are the pending changes in this workspace?”, we answer that question not by asking the server for the list of all items which have been checked out, but by scanning the working copy on disk and looking for items which the user has edited.</p>  <p>This means that with a local workspace, you can pull up a source-controlled file in your favorite non-Visual Studio editor, make a change, save the file, and then immediately see your pending edit on the item reflected in the Pending Changes Page of the Team Explorer. No explicit checkout is necessary.</p>  <h5>Detected changes (or ‘candidate’ changes)</h5>  <p>While edits in a local workspace can be pended implicitly just by editing the file, adds and deletes still must be explicitly pended. However, TFS version control’s workspace scanner also detects new files which are ‘candidates’ for addition, and missing files and folders which are candidates for deletion. The Team Explorer’s Pending Changes Page has a link which shows the number of detected adds and deletes, and provides a link to the Promote Candidate Changes dialog which can be used to pend ‘real’ adds or deletes on these items. This is called “promoting” the candidate adds and/or deletes – because they become real pending changes. </p>  <p>Detected candidate adds can also be ignored from this dialog so that they no longer show up. Your .tfignore file will be updated to include an exclusion which applies to the items you have ignored. If you do not have a .tfignore file, one will be added for you.</p>  <h5>Invisible to VS 2010 and earlier</h5>  <p>Because local workspaces use a local data store that only VS 2012 and later know how to read and write, local workspaces are invisible to VS 2005, 2008, and 2010 clients which might be installed on the same machine as your VS 2012 instance. If you want to share your workspace between VS 2012 and VS 2010 on the same machine, then local workspaces aren’t for you and you should convert your workspace back to a server workspace so that VS 2010 can see it.</p>  <h5>No enforcement of PendChange permission or checkout locks</h5>  <p>Because local workspaces allow users to pend and undo pending changes without ever calling the TFS server, these mechanisms for restricting when an item can be checked out are ineffective in local workspaces. Checkin locks still work just fine, but the act of taking or releasing a checkin lock requires a call up to the TFS server.</p>  <h5>Converting to and from local workspaces</h5>  <p>The “Edit Workspace” dialog can be used to change your workspace type from local to server, or vice versa. The setting is in a combo box marked “Location.” You will need to click the “Advanced &gt;&gt;” button at the bottom of the dialog in order to see the combo box. Once you have made your selection for workspace location (local or server), click OK to make the change effective.</p>  <p>Converting from a local workspace to a server workspace is a fairly quick operation. Going from server to local can take up to a few minutes to complete because backup copies of each file in your workspace are taken and saved off in a hidden folder. These backup copies are required to support offline undo and offline diff operations, neither of which would be possible without a backup copy to undo back to, or a backup copy to compare against.</p>  <h5>Performance and scalability</h5>  <p>As mentioned above, local workspaces keep a backup copy of each file in the workspace. These copies are compressed, but typically this means that a local workspace takes up about 50% more space on disk than an equivalent server workspace. If disk space is a concern for you, server workspaces may be more appropriate. These backup files are deleted when converting your workspace from local to server.</p>  <p>Local workspaces have scalability limitations due to their use of the local workspace scanner which checks for edited items. Local workspaces are recommended for most of our customers, because most workspaces fit into the “small” or “medium” category in our view – that is, they have fewer than 50,000 files and folders. If your workspace has more than 50,000 items, you may experience performance problems or TF400030 errors as operations exceed 45 seconds in duration. In this case, splitting your workspace up into multiple smaller workspaces (perhaps one workspace per branch), or switching to server workspaces is recommended.</p>  <p>Server workspaces are optimized for performance at large scale and can support workspaces with up to 10,000,000 items (provided your SQL Server hardware is sufficient).</p>  <h5>Default workspace location</h5>  <p>The default workspace location (local or server) for your Team Project Collection can be changed by launching the Team Explorer and going to the Settings page. Under “Team Project Collection,” select “Source Control.” On the “Workspace Settings” tab, you can change the default workspace type from local to server or vice versa.</p>]]></content:encoded>
    </item>
    <item>
      <title>Workspaces</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/workspaces</link>
      <pubDate>Mon, 27 May 2013 17:58:27 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2013/05/27/workspaces/</guid>
      <description><![CDATA[What is a workspace?  TFS version control has two main objects to interact with.     The version...]]></description>
      <content:encoded><![CDATA[<p><b>What is a workspace?</b></p>  <p>TFS version control has two main objects to interact with.</p>  <ol>   <li>The version control server. There is exactly one of these in every Team Project Collection, and it’s shared by everyone.</li>    <li>Your workspace – this belongs to you. You can have as many workspaces as you would like.</li> </ol>  <p>Your workspace is the ‘owner’ or ‘container’ of a variety of important artifacts.</p>  <ol>   <li>Your working folders, or “mappings” – these declare what portions of the version control server will be brought to your local disk to create your working copy. You can have a workspace without any working folders – but without any, you’re saying that you want to have an empty working copy, which isn’t very useful. An example of a mapping might be “$/Project -&gt; C:\Workspaces\Project”.</li>    <li>Your pending changes. When you want to make changes to the version control server’s copy of the source code, you pend your changes against your working copy. When you have finished preparing your changes, you check in from the workspace to the version control server. You can also shelve your pending changes to create a ‘shelveset’ on the server, or unshelve someone else’s pending changes into your workspace to use them temporarily or to check them in.</li>    <li>Your conflicts, if you have any.</li>    <li>(Advanced topic!) Your local version table – while the working folders define what you want your working copy to look like, the local version table describes what the working copy looks like ‘right now.’</li> </ol>  <p>In addition to owning the artifacts above, workspaces have a variety of properties.</p>  <ol>   <li>Each workspace exists on a particular <b>version control server</b>.</li>    <li>A <b>name</b> – the default name is the name of your computer.</li>    <li>An <b>owner</b> – an identity known to Team Foundation Server.</li>    <li>A <b>comment</b> field in which a description of the workspace can be stored.</li>    <li>Each workspace exists on a particular <b>computer name</b>.</li>    <li>Each workspace is either a <b>server workspace</b> or a <b>local workspace</b>.</li>    <li>Files downloaded to the working copy can either have their <b>last-modified date</b> set to the time of download (default) or to the last check-in date of the file.</li>    <li>Workspaces are <b>permissioned</b> objects – by default, they are private, meaning only the owner can use them.</li> </ol>  <p>Each of the properties described above can be changed, except for the version control server on which the workspace exists. That particular property of the workspace is immutable.</p>  <p><b>Workspace names</b></p>  <ul>   <li>The maximum length of the workspace name is 64 characters.</li>    <li>Workspace names are unique for each owner (on each version control server). That is to say, I can have a workspace named HELLO_WORLD, and you can have a workspace named HELLO_WORLD, but neither one of us can have two workspaces named HELLO_WORLD. Generally it’s best to think of the uniqueness constraint as applying to the name;owner combination, which we also call a ‘workspacespec’. Under this scheme, it’s easy to see that the workspacespec “HELLO_WORLD;DOMAIN\You” is different from “HELLO_WORLD;DOMAIN\Me”. </li>    <li>The default name for a workspace is the name of the computer on which it was created. If that name is already taken, a “_1” or “_2”, etc. is appended onto the end of the name until an available name is found.<b></b></li> </ul>  <p><b>Workspace owners</b></p>  <ul>   <li>The owner of a workspace is the identity who created the workspace.</li>    <li>When changing the owner of a workspace, the identity receiving ownership does not get a chance to reject acquisition. It is a gift which that identity must accept.</li>    <li>Depending on the situation, the caller may lose all permissions (except Read) to the workspace after changing the owner. Most workspaces are ‘private’ and only grant Use, Checkin, and Administer permissions to their owner.</li>    <li>The “Edit Workspace” dialog will not let you change the owner and the permissions of the workspace at the same time.</li>    <li>Prior to TFS 2010, the owner of a workspace cannot be changed.</li> </ul>  <p><b>Workspace comment</b></p>  <ul>   <li>The workspace comment is a string with essentially unlimited length. We will let you store up to 2^30 characters in the workspace comment. However, I believe that some of the earlier versions of TFS may restrict the comment length to 2,048 characters.</li>    <li>The comment field is blank by default.</li> </ul>  <p><strong>Computer name</strong></p>  <ul>   <li>Each workspace exists on a particular computer. The computer name field can be up to 31 characters long, and this property is set for you automatically.</li>    <li>The TFS server does not do anything with this data other than persist it, and allow clients to use it as a query filter. For example, the query “tell me all the workspaces I have access to on this machine&quot; is very common.</li>    <li>In certain situations, you may want to change the computer name of an existing workspace. For example, if you change your computer name, you may need to update the computer name on all your workspaces. Another scenario is moving a detachable volume (for example, a virtual hard disk) from one machine to another. As long as the local paths of the items stay the same (you mount the volume with the same drive letter), then you can update the computer name of the workspace, and immediately continue using it.</li>    <li>Functionality for changing the computer name of a workspace is limited to the command line only – the “/computer:newcomputername” switch to the “tf workspace” command allows you to specify a new computer name. This switch is new in Visual Studio 2010.</li>    <li>You can update the computer name for a set of workspaces by using the “/updateComputerName:oldcomputername” switch of the “tf workspaces” command. Note carefully that this is a different command – ‘tf workspaces’ – and that this switch requires you to specify the old computer name. The new computer name is inferred from the machine on which you run the command. This command has existed since Visual Studio 2005 and is intended for use in the scenario where you rename your computer.</li> </ul>  <p><strong>Workspace location</strong></p>  <ul>   <li>Starting with TFS 2012 and Visual Studio 2012, workspaces have a “Location” property. A workspace’s location can either be “server” or “local.”</li>    <li>Local workspaces are new in TFS 2012 and Visual Studio 2012. All workspaces on TFS 2005, TFS 2008, and TFS 2010 servers are server workspaces.</li>    <li>If your “Edit Workspace” dialog doesn’t show the workspace location combo box (you may need to click “Advanced &gt;&gt;” to see it), then your client must be Visual Studio 2005, 2008, or 2010, which don’t support local workspaces. This means your workspace is a server workspace.</li>    <li>If your “Edit Workspace” dialog does show the workspace location combo box, but it is not editable (it is permanently set to “Server”), then your client is Visual Studio 2012 or later and does support local workspaces. However, your server is older than TFS 2012 and does not support them.</li>    <li>There is a long list of differences between server workspaces and local workspaces – enough to fill several blog posts. I hope to blog on this topic in the future.</li>    <li>If your server and client both support local workspaces, then you can freely convert between the two by changing the setting in the combo box and clicking OK to commit your changes to the workspace. The conversion process can take some time; going from local to server is quicker than going from server to local. There is a progress dialog which is shown during this conversion.</li> </ul>  <p><strong>Last-modified date</strong></p>  <ul>   <li>When you do a “Get” in TFS version control to update your working copy, files are downloaded from the server and placed on your local disk.</li>    <li>Each file on your local disk has a last-modified date. In Visual Studio 2005, 2008, and 2010, the last-modified date of downloaded files is not set to any special value. It gets set to whatever the current time is at the time the file is downloaded.</li>    <li>Starting in Visual Studio 2012 and TFS 2012, you have the option to change the last-modified date setting from “<strong>Current</strong>” to “<strong>Checkin</strong>”. This setting is hidden behind the “Advanced &gt;&gt;” button in the “Edit Workspace” dialog.</li>    <li>Just like with local workspaces (above), you need both Visual Studio 2012 or higher and TFS 2012 or higher in order to change this setting to “Checkin.”</li>    <li>If set to “Checkin,” then downloaded files (not folders) will have their last-modified time set to the date and time that the item was checked into source control. There is a small performance cost to enabling this feature.</li>    <li>When you change this setting on an existing workspace, the items you already have downloaded will not have their last-modified times instantly updated. You will need to perform a “tf get /all” in order to get them all set correctly.</li>    <li>Most customers do not need to set this setting to “Checkin,” but some have custom workflows or build orchestrations that require the last-modified dates to be set this way.</li> </ul>  <p><strong>Workspace permissions</strong></p>  <ul>   <li>Starting in TFS 2010, workspaces are permissioned objects. There are four permissions on workspaces – Read, Use, Checkin, and Administer.</li>    <li>If you have <strong>Read</strong> permission on a workspace, its existence and its properties (including its local version table and pending changes) are visible.</li>    <li>If you have <strong>Use</strong> permission on a workspace, you can create and undo pending changes, update the local version table, shelve pending changes, etc.</li>    <li>If you have the <strong>CheckIn</strong> permission on a workspace, you can check in the pending changes from the workspaces.</li>    <li>If you have the <strong>Administer</strong> permission on a workspace, you can modify the properties of the workspace in the “Edit Workspace” dialog, or delete the workspace.</li>    <li>The owner of the workspace always has all permissions on the workspace.</li>    <li>All valid users of the Team Project Collection have Read permission on all workspaces. (This is subject to change in future releases of TFS.)</li>    <li>Instead of providing a full permissioning UI experience, the “Edit Workspace” dialog lets you pick between a set of predefined “permission profiles.” The default is “<strong>private workspace</strong>”, where only the owner has permissions on the workspace.</li>    <li>Other profiles include Public-Limited and Public – in these profiles, permission to Use, Checkin, and/or Administer are extended to all valid users of the Team Project Collection. These permission profiles are useful if you want to have a machine with a single workspace, shared by multiple users.</li>    <li>You can read more about workspace permissions in <a href="https://blogs.msdn.com/b/phkelley/archive/2010/02/04/improvements-to-workspaces-in-tfs-2010.aspx">this blog post</a>.</li> </ul>]]></content:encoded>
    </item>
    <item>
      <title>tf get /remap</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/tf-get-remap</link>
      <pubDate>Fri, 18 May 2012 12:43:23 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2012/05/18/tf-get-remap/</guid>
      <description><![CDATA[This switch was added to &quot;tf get&quot; to improve performance when a user is switching an...]]></description>
      <content:encoded><![CDATA[<p>This switch was added to &quot;tf get&quot; to improve performance when a user is switching an existing workspace from one branch to another. The performance benefit is best explained with an example.</p>  <p>Let's say that in our Team Project Collection we have one Team Project (<font face="Courier New">$/Proj</font>), and two branches -- <font face="Courier New">$/Proj/Main</font> and <font face="Courier New">$/Proj/Dev</font>. And let's also say that we have a workspace which maps <font face="Courier New">$/Proj/Main</font> to <font face="Courier New">C:\MyWorkspace</font>. Our source tree is pretty small -- we only have 5 files, named a.cs through e.cs. I've done a get, and so when I look in <font face="Courier New">C:\MyWorkspace</font>, this is what I see:</p>  <p><font face="Courier New">C:\MyWorkspace&gt;dir     <br /> Volume in drive C is Physical Disk 1       <br /> Volume Serial Number is BA8F-FF44</font></p> <font face="Courier New"></font>  <p><font face="Courier New"> Directory of C:\MyWorkspace</font></p> <font face="Courier New"></font>  <p><font face="Courier New">05/18/2012&#160; 01:41 PM&#160;&#160;&#160; &lt;DIR&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .      <br />05/18/2012&#160; 01:41 PM&#160;&#160;&#160; &lt;DIR&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ..       <br />05/18/2012&#160; 01:41 PM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 14 a.cs      <br />05/18/2012&#160; 01:41 PM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 54 b.cs      <br />05/18/2012&#160; 01:41 PM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 5 c.cs      <br />05/18/2012&#160; 01:41 PM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 115 d.cs      <br />05/18/2012&#160; 01:41 PM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 17 e.cs      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 5 File(s)&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 205 bytes       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 2 Dir(s)&#160; 60,134,879,232 bytes free</font></p>  <p>Let's also say that my co-worker, John, has made a change in the Dev branch to c.cs. He's really added a big chunk of code in the Dev branch, and so the c.cs file there is much bigger. But he hasn't changed any of the other four files. The other four files are exactly the same in Dev and Main.</p>  <p>Furthermore, for some reason (maybe John and I need to work more closely together now) I need to switch my workspace from mapping the Main branch to having the Dev branch. The way I would do this is through the &quot;tf workspace&quot; dialog.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/0257.remap1_01FDC5A7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/0257.remap1_5F00_01FDC5A7.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="remap1" border="0" alt="remap1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/6433.remap1_thumb_0C4EEA07.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/6433.remap1_5F00_thumb_5F00_0C4EEA07.png" width="470" height="229" /></a></p>  <p>Change the server path mapping only, from <font face="Courier New">$/Proj/Main</font> to <font face="Courier New">$/Proj/Dev</font>. Leave the local path part (<font face="Courier New">C:\MyWorkspace</font>) the same.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/2804.remap2_20680690.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/2804.remap2_5F00_20680690.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="remap2" border="0" alt="remap2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/3884.remap2_thumb_26AEDD1E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/3884.remap2_5F00_thumb_5F00_26AEDD1E.png" width="470" height="229" /></a></p>  <p>When you click OK, you'll be prompted to do a get.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/2308.remap3_25D67734.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/2308.remap3_5F00_25D67734.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="remap3" border="0" alt="remap3" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/14/68/metablogapi/7178.remap3_thumb_09598554.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-14-68-metablogapi/7178.remap3_5F00_thumb_5F00_09598554.png" width="393" height="145" /></a></p>  <p>If I say yes, a regular get will be performed, and everything will work fine -- but the get will be inefficient. Let's watch what happens when I click yes.</p>  <p><font face="Courier New">C:\:      <br />Getting MyWorkspace      <br />Deleting C:\MyWorkspace\a.cs</font></p> <font face="Courier New"></font>  <p><font face="Courier New">C:\MyWorkspace:      <br />Getting a.cs      <br />Deleting C:\MyWorkspace\b.cs      <br />Getting b.cs      <br />Deleting C:\MyWorkspace\c.cs      <br />Getting c.cs      <br />Deleting C:\MyWorkspace\d.cs      <br />Getting d.cs      <br />Deleting C:\MyWorkspace\e.cs      <br />Getting e.cs</font></p>  <p>Each item is deleted and re-downloaded as part of the switch from <font face="Courier New">$/Proj/Main</font> to <font face="Courier New">$/Proj/Dev</font>. Even the four items that are identical in the two branches are redownloaded, which is not a good use of time.</p>  <p>Let's look at what would have happened if I had said &quot;no&quot; to the dialog, and then run a &quot;tf get /remap&quot;.</p>  <p><font face="Courier New">C:\MyWorkspace&gt;tf get /remap      <br />Deleting C:\MyWorkspace\c.cs      <br />C:\MyWorkspace:       <br />Getting c.cs</font></p>  <p>You can see that no action was taken for the four items which are identical. As a result no time was expended downloading these four items unnecessarily.</p>  <p>Why not run “tf get /remap” all the time? Nothing bad would happen if you were to do so. However, adding the /remap switch does increase the amount of work done by the server to process your request. As a result, it is not on by default.</p>]]></content:encoded>
    </item>
    <item>
      <title>WorkspaceCheckInParameters and ShelvesetCheckInParameters</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/workspacecheckinparameters-and-shelvesetcheckinparameters</link>
      <pubDate>Fri, 26 Feb 2010 11:11:00 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2010/02/26/workspacecheckinparameters-and-shelvesetcheckinparameters/</guid>
      <description><![CDATA[Many Team Foundation Server customers have developed custom tools and processes that leverage our...]]></description>
      <content:encoded><![CDATA[<p>Many Team Foundation Server customers have developed custom tools and processes that leverage our public client object model in order to automate tasks specific to their organization. With version control, one of the most common tasks to automate is checking in. Since our initial release in 2005, customers have been able to use the <a href="https://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.workspace.checkin.aspx" target="_blank">Workspace.CheckIn</a> family of methods for this purpose.</p>  <p>In TFS 2010, we’ve added new features related to the process of checking in, but we didn’t want to create more and more overloads of the Workspace.CheckIn method to support them. As a result, in 2010 we’ve added a single new overload that takes a WorkspaceCheckInParameters object.</p>  <p><font size="2" face="Consolas"><span style="color: blue">public int</span> CheckIn(<span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span> checkinParameters);</font></p>  <p>The legacy methods from TFS 2005 and 2008 are still present and fully supported. But you may find that flags and settings related to new features of TFS 2010 (such as gated check-in) are only available through the WorkspaceCheckInParameters overload.</p>  <p>Put simply, the WorkspaceCheckInParameters object encapsulates all the necessary information to complete a check-in from a workspace. Here’s a simple example which checks in all pending changes, with a provided comment.</p>  <p><font size="2" face="Consolas"><span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span> wcip = new <span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span>(myWorkspace.GetPendingChanges(), “My changeset comment!”);       <br />myWorkspace.CheckIn(wcip);</font></p>  <p>The above example is equivalent to the following call that uses one of the older CheckIn() overloads. In simple cases like this, we don’t expect that you’ll go to the trouble of using a WorkspaceCheckInParameters object. There’s no advantage to it in this case.</p>  <p><font size="2" face="Consolas">myWorkspace.CheckIn(myWorkspace.GetPendingChanges(), “My changeset comment!”);</font></p>  <h3></h3>  <h3></h3>  <h3>An advanced example</h3>  <p>The constructors on WorkspaceCheckInParameters are intentionally limited. If we were to go down the road of implementing constructor overloads for every possible combination of flags and parameters, we would have put ourselves back in the same place we started – a nightmare situation of dozens of overloads. Instead, the model we’ve taken is to provide reasonable defaults on the WorkspaceCheckInParameters object. You can then adjust whatever flags and parameters are needed for your scenario before calling Workspace.CheckIn.</p>  <p>Here’s a more complex example which tries to commit a changeset on behalf of another user, and bypasses gated check-in if any of the pending changes being committed are to paths protected by a gated build definition.</p>  <p><font size="2" face="Consolas"><span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span> wcip = new <span style="color: rgb(43,145,175)">WorkspaceCheckInParameters</span>(“My comment!”);       <br />wcip.PendingChanges = myWorkspace.GetPendingChanges();</font><font size="2" face="Consolas">      <br />wcip.Author = “CONTOSO\ClarkKent”;       <br />wcip.OverrideGatedCheckIn = true;       <br />myWorkspace.CheckIn(wcip);</font></p>  <p>You’ll find that this call will fail if you don’t have permission to override gated check-in, or permission to check in on behalf of another user. (It will also fail if the user CONTOSO\ClarkKent doesn’t exist. <font size="2" face="Wingdings">J</font>)</p>  <h3>Checking in a shelveset directly</h3>  <p>One new feature in TFS 2010 is the ability to directly check in a shelveset. In previous releases, customers were required to unshelve the shelveset into a workspace and check in from there. To support this feature we’ve added new methods to the <a href="https://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.versioncontrolserver.aspx" target="_blank">VersionControlServer</a> object.</p>  <p><font size="2" face="Consolas"><span style="color: blue">public int</span> CheckInShelveset(<span style="color: rgb(43,145,175)">String</span> shelvesetName, <span style="color: rgb(43,145,175)">String</span> ownerName);       <br /><span style="color: blue">public int</span> CheckInShelveset(<span style="color: rgb(43,145,175)">ShelvesetCheckInParameters</span> shelvesetCheckInParameters);</font></p>  <p>There is some intentional parallelism here with the Workspace.CheckIn methods. The first method is likely to be the most commonly used, just as the older, non-WorkspaceCheckInParameters methods are likely to be the most commonly used workspace check-in methods. For advanced scenarios, you can instantiate a ShelvesetCheckInParameters object, adjust the flags, and then call CheckInShelveset.</p>  <p>Here’s an example which checks in a shelveset BugFixes;CONTOSO\ClarkKent and then deletes the shelveset if the check-in successfully completes.</p>  <p><font size="2" face="Consolas"><span style="color: rgb(43,145,175)">ShelvesetCheckInParameters</span> scip = new <span style="color: rgb(43,145,175)">ShelvesetCheckInParameters</span>(“BugFixes”, “CONTOSO\ClarkKent”);       <br />scip.DeleteShelveset = true;       <br />myVersionControlServer.CheckInShelveset(scip);</font></p>  <p>Since the Author property of the ShelvesetCheckInParameters was not specified in this case, the changeset resulting from this check-in will be attributed to the user who called CheckInShelveset, not the owner of the shelveset. Additionally, the requested deletion of the shelveset only occurs if the calling user has CheckinOther permission for the items in the shelveset. (This is so a non-privileged user cannot go around causing others’ shelvesets to disappear.)</p>]]></content:encoded>
    </item>
    <item>
      <title>Workaround: Slow version control operations when using VS 2010 with an older server</title>
      <link>https://docs.microsoft.com/archive/blogs/phkelley/workaround-slow-version-control-operations-when-using-vs-2010-with-an-older-server</link>
      <pubDate>Tue, 23 Feb 2010 11:06:50 GMT</pubDate>
      <dc:creator><![CDATA[P. Kelley]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/phkelley/2010/02/23/workaround-slow-version-control-operations-when-using-vs-2010-with-an-older-server/</guid>
      <description><![CDATA[Updated 2/25/2010. Thanks to Shaun and Amos for their recommended changes!  One of the new features...]]></description>
      <content:encoded><![CDATA[<p><strong>Updated 2/25/2010. Thanks to Shaun and Amos for their recommended changes!</strong></p>  <p>One of the new features of TFS 2010 is automatic version control proxy configuration. The first time a version control operation is executed, the client contacts the server and asks for proxy configuration information. If no proxy is available for the client, it will ask again after 24 hours have passed.</p>  <p>To allow proxies to be auto-configured by location, the client provides to the server its “site name” from Active Directory. This data is used by the server to determine which of several proxies to assign the client to. Clients in Germany can be assigned to the Germany proxy, and clients in South Africa to the South Africa proxy. This is the same mechanism that Windows uses with the Add Printer Wizard to show printers physically close to you.</p>  <p>Unfortunately, there is a bug in the automatic proxy configuration mechanism of the VS 2010 client when communicating with a 2005/2008 server. When used against an older server, no query can be made to auto-configure a proxy because the server does not support the functionality. <strong>But the site name from Active Directory is still retrieved</strong>, on every version control operation from the list below.</p>  <ul>   <li>Get </li>    <li>Merge </li>    <li>Unshelve </li>    <li>Edit </li>    <li>Delete </li>    <li>Undelete </li>    <li>Rename </li>    <li>Undo </li>    <li>Add </li>    <li>Branch </li>    <li>Resolve </li> </ul>  <p>In all cases, there is some performance penalty for retrieving this data from LDAP. But in some cases it can be particularly bad. One customer reported a delay of 8 to 9 minutes to retrieve the site name from Active Directory. <strong>Fortunately, there is a workaround available for this issue.</strong> If you are using VS 2010 against a TFS 2005/2008 server, you may notice an increase in performance by disabling automatic proxy configuration through the use of the following registry settings.</p>  <p>Check your version control proxy settings in Visual Studio first, by going to Tools –&gt; Options –&gt; Source Control –&gt; Visual Studio Team Foundation Server. If you have a proxy configured, your proxy server protocol, name, and port will be available there, and you should not be affected by this issue. (If you want to be 100% sure, instructions for verifying your proxy settings are below.)</p>  <h3></h3>  <h3>No version control proxy:</h3>  <p>These settings are for users who are not using a proxy server. All files are downloaded from the central TFS server directly.</p>  <blockquote>   <p><font size="2" face="Courier New">Windows Registry Editor Version 5.00 </font></p>    <p><font size="2" face="Courier New">[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Proxy]        <br />&quot;Enabled&quot;=&quot;False&quot;         <br />&quot;Url&quot;=&quot;https://dummy.example.com/&quot;        <br />&quot;AutoConfigured&quot;=&quot;False&quot; </font></p> </blockquote>  <h3>Manually configured version control proxy:</h3>  <p>You should not have to take any further action. If you like, you can inspect your registry settings to ensure they look like those below. (If you happen to have “LastCheckTime” or “LastConfigureTime” values in addition to these values, that’s normal and they are harmless.)</p>  <blockquote>   <p><font size="2" face="Courier New">Windows Registry Editor Version 5.00 </font></p>    <p><font size="2" face="Courier New">[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Proxy]        <br />&quot;Enabled&quot;=&quot;True&quot;         <br />&quot;Url&quot;=&quot;https://yourversioncontrolproxy:8081/&quot;         <br />&quot;AutoConfigured&quot;=&quot;False&quot; </font></p> </blockquote>  <h3>Installing the workaround settings</h3>  <p>Copy/paste the text into Notepad, save it as a .reg file, and execute it. You’ll be prompted to authorize the merging of this data into the registry. Be sure to restart Visual Studio for the changes to take effect.</p>]]></content:encoded>
    </item>
  </channel>
</rss>