Visual studio 2019 - Git - Compare with unmodified - visual-studio-2019

Suddenly, the diff window only shows the new version of the file.
When it used to show it (in green) and the HEAD version (in red), Side by side
How can i get it back ?
https://i.stack.imgur.com/WtQLs.png

Referring to this link.
You can try to use click "Side-by-side mode" on Visual Studio's toolbar
https://i.stack.imgur.com/kzySf.png

Related

Visual Studio 2019 and Git Update View Problem

I'm developing a ASP.Net MVC 5 application using Visual Studio 2019. I also am using Git and GitHub with this project (first time - previously I have used TortoiseSVN).
I've noticed that when I make a change to a Razor View, a red tick will appear beside the file in Visual Studio to signify that something has changed within the View.
However, I can only see the changes I've made within the View if I stop debugging, and then restart. Normally I could make a change to the Razor View whilst debugging, e.g. a text change, Save the Razor View within Visual Studio, and then F5 or Ctrl F5 within the browser and the page with refresh with the latest text change.
For some reason I believe this is related to Git because I have other MVC 5 applications on my laptop within the same folder structure which are not using Git, and this problem does not exist.
Surely I don't have to stop debugging and restart every time I want to see a change to a View?
Could someone please help?
Thanks.

Visual Studio 2019 - remove double CTRL+S as a short cut of save file as

How do I remove the shortcut to save file as when I do ctrl + s twice in a row in VS 2019?
You should be able to change it in Tools>Options>Environment>Keyboard
If you can't that specific setting you can set that keybind as a secondary one for save file and it should erase the other keybind.
For more info about changing keybinds in visual studio here is the documentation : https://learn.microsoft.com/en-us/visualstudio/ide/identifying-and-customizing-keyboard-shortcuts-in-visual-studio?view=vs-2019

Any way to just view conflicts in Visual Studio 2012

Is it possible to just view conflicts in Visual Studio 2012, without merging or checking in. In 2012 you used to be able to Get Latest Version then go to the pending view and click the show conflicts icon.
I'm keen know if you can do this without any add-ons / external commands, i.e. just using what Visual Studio 2012 standard installation has, without for example either of the following:
Team pilgrim:
http://visualstudiogallery.msdn.microsoft.com/79e9baa7-ea8b-4335-86ba-ae929bf67222
Or:
tf checkin
I was just searching for an answer to this myself, when I found out how you can do this. Here is how to can just view conflicts.
Go to the Team Explorer and select Pending changes. In the Pending changes window there is a dropdown menu named Actions, click that menu and in the menu is an option Resolve conflicts.
Click that option and a window will be opened showing all conflicts in the workspace similar to the resolve conflicts window of VS2010.
Hope it helps.
Use the "Compare To" option in the right click menu. You can choose to generate a diff between any two versions.
Alternatively, you can do basically the same option with 2012. You can get latest, which will throw any conflicts that exist between the local version and the server version. Conflicts can then be resolved locally, and then either discarded or checked in.
To remove automatic conflict resolution:
`Ctrl+Q --> "Conflict" --> ENTER --> Uncheck "Attempt to automatically resolve conflicts when they are generated"

TFS Folder Difference -> View Target bug?

Is this a bug in TFS 2010? Has anyone else come across this? Am I doing something wrong?
Steps to reproduce:
Right click on a folder in the Source Control Explorer and choose View History.
Right click a changeset and choose Compareā€¦
For the Target Path, pick another (more recent) changeset and press OK.
In the resultant Folder Differences window, right-click on a file with differences and select Compare Files. Note the differences, and leave the compare tool open for future reference.
Back in the Folder Differences window, right click the same file and choose View. Choose the Source and confirm that you do indeed view the source version. (Cross-check with the compare tool left open in step 4.)
Back in the Folder Differences window, right click the same file and choose View. Choose the Target.
Expected result: to see the target version of the file.
Actual result: I get the source version of the file again.
Does anyone else get this?
Yes, this is a bug in VS 2010 and I can reproduce it using the RTM and SP1 versions. I can also confirm that this has been fixed in VS 2012 which is currently in Beta. As a workaround, when you right click on the item, select View History. This will show you the history of the file and from there you can right-click on the version you are interested and select "View".
Sorry about the inconvenience.
-Taylor, TFS Version Control Development Lead

How can I open a single changeset in TFS from within Visual Studio

Someone emailed me a TFS changeset ID and now I am trying to open this single changeset. Is there an easy was to do this from within Visual Studio (VS 2008 if it matters)?
In Visual Studio a keyboard shortcut can be used for pulling up a specific Changeset or Work Item.
Go to Changeset
In Visual Studio open the Source Control Explorer window and while it has context press Ctrl + G. Enter the number in the Go To Changeset dialog and press OK.
I know this works in VS 2010, 2012 and 2013, but recall this working as far back as at least Visual Studio 2008.
Go to Work Item
Pressing Ctrl + G when the Team Explorer Work Items window has context brings up the Go To Work Item dialog:
In Visual Studio 2012 and 2013 the TEAM menu contains an option Go to Work Item which also brings up this dialog.
Last Word
Visual Studio is a very contextual program and what happens when a specific keyboard command is used is oftentimes influenced by what window has context. To be clear pressing Ctrl + G when an editor window is open will present the Go To Line dialog.
As with many keyboard commands in Visual Studio your mileage will vary.
In the Source Control Explorer (View -> Other Windows -> Source Control Explorer):
Right click on the folder you want to grab
Click Get Specific Version
Change the dropdown from "Latest Version" to "Changeset"
Find your changeset on via the browse (...) button.
Change to search to changeset number
Just select the result and hit ok.
Alternatively, if you want to see what changes were in that changeset...
Go to the same Source Control Explorer
Click the History button (looks like a clock)
Scroll down the changeset list that appears, double click the one you want.
This will list the files changed in that changeset as well as notes the developer put.
or, from a VS command prompt type "tf changeset 1234" (make sure that your root folder is inside of your workspace or you will have to explicitly define the team project etc.)
You don't need to remember Ctrl + G shortcut, just do as below.
Open the source Control Explorer -> Right Click -> Find in Source Control -> Changeset
Then a dialog box will appear where u can specify your changeset number hit find. And it will appear in results section at the bottom, then you could go into all its details.
In the NugGet console, you can use the TFS Powershell Snapin from the TFS PowerTools.
Add-PsSnapin Microsoft.TeamFoundation.Powershell
Get-TfsChangeset <ChangesetNumber>
Another option is to open Tools > External Tools and add a new external tool that calls TF.exe changeset and prompts for arguments where you can give the changeset number.
In VS2012 you have the option to search in changesets.
if you want to search changeset...
Go to Source Control Explorer Click the Find Changeset(looks like some papers tied together) button. it is near to history button (looks like a clock)
you can search by changes checkedin by a user,containing file,and date range
try to add as much filter as possible, otherwise it will take sometime to load.

Resources