Tracking changes in Visual Studio - 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.

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.

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.

I want "track changes" in Visual Studio to show changes that have not been commited to version control

"Track changes" in Visual Studio shows what lines have been edited in the current session (shown next to the scroll bar). But to me it is much more meaningful to see what lines have changed from the last version in version control.
In Eclipse this is possible. Is it possible to have the same in Visual Studio? I am using VisualHg, and Mercurial, but I suppose the same principle should apply for other version control solutions.
I suppose you want to see the changes next to the scroll bar such as the track changes.
I don't know how to achieve that. But I use TortoiseSVN and have an addon for VS (ankhSVN is the name, I guess), which lets me do a right click on the file and do show changes. There pretty sure is an equivalent addon for mercurial.
Maybe an addon such as Power Tools or VS Commands may provide a way of marking the lines you've changed next to the scroll bar.

How do I know which files I actually changed since my last TFS checkout?

I've checked out a bunch of files from TFS in VS2010 and made changes to several of them. How can I see which files I actually made changes to?
Use the TFS power tools. Open a visual studio command prompt, navigate to your workspace and then type
tfpt uu /noget /recursive
This will undo any pending changes on files that haven't been modified
Is View -> Other Windows -> Pending Changes what you are looking for? That lists all of the changes in your selected workspace that are pending a check-in. It looks (and behaves) differently in VS2010, but here's what it looks like in VS2012.
To add to hawkke's answer, I use CTRL-K C to show the pending changes window - very useful.
(hit ctrl-k and the then 'C' key right after).

How to revert file in Visual Studio 2010 (reload the file from disc)

I'm starting to use Visual Studio (2010) after years with Eclipse.
Every now and then I've found Eclipse's "Revert" feature pretty useful, that is, to reload the file from disk, discarding all changes. (Nothing to do with version control reverting.)
How can I do this with Visual Studio? Should be pretty simple but I haven't found it yet.
I know that I can do this with "undo until *-indicator disappears" but that's pretty impractical.
Unfortunately I do not know of a built-in way to do this in VS other than closing the file and reopening it without saving.
There might be some extension that does this, but I am not aware of it :(
In the current version, you find in the Explorer, in the left sidebar. Then Open Editors, and right click on the file you want to revert.
If you are using git with Visual Studio:
Solution Explorer > Right Click On File > Git > Undo Changes

Resources