Missing "Compare with Current Branch" menu option - visual-studio

According to Microsoft docs - Browse Git repositories and compare branches in Visual Studio, I should have a Compare with Current Branch menu option right after View history. However, I don't have them, in neither the branch picker nor the 'Git Repository' window.
I'm using Microsoft Visual Studio Professional 2019, Version 16.11.16. This answer suggests this feature was available since Visual Studio 2017 Edit: Reading again, looks like it's a different feature.
Edit: I do get it with Visual Studio 2022 Community, Version 17.3.0, on the exact same clone. It's now named Compare 'mybranch' with 'main'. This visualstudio blog post suggests it's a new feature, so maybe the documentation incorrectly attributes it to VS2019...

Related

Visual Studio 2019 Team Explorer missing GitHub option panels

So I just installed VS 2019 and right of the box, I am not seeing the options for Github as I can see on 2017.
Here is what I am seeing:
I am expecting to see this:
What could cause the options not showing up? I can see them on VS 2017. TIA.
To Solve this problem we need to simply disabled New Git user experience option. To do so, press "Ctrl+Q"(to search) -> now paste preview features -> uncheck New Git user experience checkbox. And Wala! you are done!
For more information check this link=> enter link description here
This is the way I solved my Problem.
I recently ran into this issue. I went to the Search box at the very top of Visual Studio, looked for preview features as mentioned in another comment, and unchecked New Git user experience. That reverted it to the old way. Then, I went back and checked it back on, and the Git Changes tab reappeared in the solution explorer window.
Something changed recently with an update to VS 2019. If you click the "Open Git Changes" link, it opens a new window that lets you do the individual Fetch, Pull and Push operations (highlighted arrows screenshot here).
As far as I can see, git was moved to a menu option "Git" in Visual Studio 2019 16.8.3. Maybe I am missing something but I can have a go and try the new menu Git > Manage Branches
Just have the same problem that i was missing the "Team Explorer" Panel (Changes, Sync etc.)in Visual Studio 2019.
When I was turning off following Option, the menu was looking like VS2017:
Git -> Options -> Environment -> Preview Feature
Turning off "New git user experience" Option.
Maybe this helps.
Here the article about the "New git user experience":
https://devblogs.microsoft.com/visualstudio/exciting-new-updates-to-the-git-experience-in-visual-studio/
I have the same problem, suddenly when I opened my Visual Studio 2019 Professional Edition, the Git connection is gone in Team Explorer, and I can't even see my projects in Azure Devops when I am already connected.
My solution is I just updated my Visual Studio by checking for new updates by going on Help Menu -> Check for Updates.

How to display the user name that delivered (TFS Check-in) the line of code in Visual Studio 2017

I work with a team of developers on a shared WPF solution on TFS.
Is there a way to display above the lines of code the name of the user who delivered them on TFS?
Not above the line, but from Visual Studio, if you right click in the file, select "Source Control" and then "Annotate" for TFVC or "Blame" for Git you should be able to see a breakdown on line level who committed the code.

Do we have Git source control explorer in Visual Studio 2017?

We get source control explorer for the TFS source control model, and it is productive.
Do we get a similar source control explorer for Git in Visual Studio 2017?
If we do have it, how do I navigate to it?
In short, no, there is no built-in UI support for Git in Visual Studio 2017.
Alternatively, you can try the following extensions based on your source control setup.
In Visual Studio, select Tools → Extensions and Updates, select Online on the left pane, search for one of the following in the search bar in the top right:
Bitbucket → install Visual Studio Bitbucket Extension
GitHub → Install GitHub Extension for Visual Studio
Git → Install Easy Git Integration Tools
The first two do a good job of providing UI controls to work with source control as they relate to Bitbucket or GitHub in a similar fashion to regular TFS integration (that you may be familiar with). I haven't tried the third one myself, and I'm not sure what that one is like.
Please see the Solution Explorer - Folder View. This can be accessed from Solution Explorer (open with CTRL+W, S), then by clicking the Solutions and Folders toggle button. In Visual Studio 2017, it looks like this:
Though it's not a 1:1 capability of the Team Foundation Source Control Explorer view, it does have the ability to view files in the local repo, open, view history, etc.
Visual Studio does not currently have Source Control Explorer for Git repositories. You might consider voting on this User Voice item to help the product team prioritize features:
https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/4178754-visual-studio-tools-for-git-extension-microsoft-g
In Visual Studio 2019, open the folder for the work space using "File->Open->Folder...". The solution explorer, via "View->Solution Explorer", should display all the files which you can then right click to view history and other GIT operations.

Tracking changes in Visual Studio

Is it possible to set up Visual Studio (2010) for tracking changes (left color symbols) not from last file open state, but from source control commited state? This is how netbeans works and it is really great feature, especially reverting text block from editor by right click... Visual Studio default tracking mode is not much useful.
EDIT 1:
Something like this way:
EDIT 2:
Now it works with latest Git Source Control Provider (http://visualstudiogallery.msdn.microsoft.com/63a7e40d-4d71-4fbb-a23b-d262124b8f4c) extension. Good job, extension developers. Left bar is standard visual studio tracker, right bar is tracker tracking changes against last commit. See picture:
EDIT 3 (12/05/2015):
Now I use standard VS git tools and for change tracking great Git Diff Margin extension. I use it with VS2013 and 2015 and it works very well. See:
For people like me that skim straight to the answer -
OP (12/05/2015) - Now I use standard VS git tools and for change tracking great Git Diff Margin extension. I use it with VS2013 and 2015 and it works very well
Git Diff Margin
Works great for me as well!
Seems like if you have Visual Studio 2013, and you're working with GIT, it does work.
Also, you can see what happens in the Team Explorer tab.
There is no such facility in VS to do this. I rely on CTRL-Z to undo. If there are too many changes, you can do a git checkout -p -- . which will walk you through all the differences and apply the ones you need. The -p (or --patch) parameter is available on git reset, git add and git checkout.
That being said, one could write an add-in to VS to give you this view.
Also, I use CTRL+- and CTRL+SHIFT+- to move back and forth between my recent cursor positions.

How do you clear your MRU list in Visual Studio?

I want to clear the list of projects on the start page...how do I do this? I know I can track it down in the registry, but is there an approved route to go?
There is an MSDN article here which suggests that you just move the projects to a new directory.
However, as you mentioned, the list of projects is kept in the registry under this key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\ProjectMRUList
and the list of recent files is kept in this key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>\FILEMRUList
Note For Visual Studio 2015:
The location has changed. You can check out this answer for details.
Some people have automated clearing this registry key with their own tools:
Visual Studio Most Recent Files Utility
Add-in for cleaning Visual Studio 2008 MRU Projects list
PowerCommands for Visual Studio 2008
Features
Clear Recent File List
Clear Recent Project List
Clear All Panes
Copy Path
Email CodeSnippet
Insert Guid Attribute
Show All Files
Undo Close
Collapse Projects
Copy Class
Paste Class
Copy References
Paste References
Copy As Project Reference
Edit Project File
Open Containing Folder
Open Command Prompt
Unload Projects
Reload Projects
Remove and Sort Usings
Extract Constant
Transform Templates
Close All
If you try opening up a project that can no longer be found, Visual Studio will prompt you for permission to remove it from the MRU list. So if you temporarily rename an appropriate top level folder to fake the projects' disappearance, you can get rid of the projects one by one.
In Visual Studio 2015 all the history lists (including search history, file MRU and project MRU) are now located at:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\MRUItems
You will see a different GUID folder for each list, and a sub-folder called Items in each of them. Find the Items folder that contains the relevant list, and just delete its parent GUID folder.
Visual Studio will re-create the GUID folder together with a new Items child folder, next time it wants to add something to the list again.
I found the MRU editor from Code Project a great tool for that. No problems with it, and it works on 2003, 2005, and 2008.
Note: This answer is specific to Visual Studio 2010.
If you don't want to manually edit the registry, you can use PowerCommands for Visual Studio 2010.
PowerCommands 10.0 is a set of useful extensions for the Visual Studio
2010 adding additional functionality to various areas of the IDE.
The specific command for clearing the registry from the extension is:
Clear Recent Project List This command clears the Visual Studio recent project list. The Clear Recent Project List command brings up a
Clear File dialog which allows any or all recent projects to be
selected.
The PowerCommands can be installed with the Visual Studio extension manager: Tools > Extension Manager > Online Gallery: search for PowerCommands for Visual Studio 2010.
Try Recently Used Files: a free addin for Visual Studio that manages MRU files on a per-project basis:
Supported for VS 2010, 2012, 2013.
For Visual Studio 2012, 2013:
http://visualstudiogallery.msdn.microsoft.com/a61cbd1d-b5a2-490b-a6bb-f0ea3ecf214a
For Visual Studio 2010:
http://visualstudiogallery.msdn.microsoft.com/45283881-5a62-4dc1-8ffb-4cbc02709947
For Visual Studio 2013:
Open the Run dialog (Press Win + R)
type: regedit
navigate to: HKEY_CURRENT_USER > Software > Microsoft > VisualStudio
click 12.0 then the files will show up on the right side.
Look for the "LastLoadedSolution", right click then click Modify
change the value to 0.
This worked for me.
I'm not sure if this solution has been posted somewhere here, but if you have VS 2013 Update 5 you can open start page, and right click project below "Recent" list, and choose "Remove from list". I don't know how about other VS versions, maybe this feature is available.
I had this issue as applied to VS 2017 where you do not have any MRU items in the registry as in the previous versions. The solution was, on the other hand, simple: go to "Tools->Extensions and Updates" and install "Power Commands for Visual Studio". After they have been installed, your File menu will look as shown below.
Just click the menu item to clear the project MRU.

Resources