Is there a way to get a specific version (from a specific commit) of a file in Visual Studio 2015 - Team Explorer/Team Services Git?
I simply wish to run the solution with a previous version of a file just to see how things used to run and then come back to the latest version to continue development.
I did not create any branches. I kept on committing in the "master" branch.
Go to Tools > Options > Environment > Preview Features and then toggle the New Git user experience checkbox, which will switch you back to Team Explorer for Git." According to Git for Visual Studio 2022, For Visual Studio 2022, the new Git Experience is the only Git experience.
Visual Studio uses the Sync view in Team Explorer to fetch changes. Changes downloaded by fetch aren't applied until you Pull or Sync the changes. In Team Explorer, select the Home button and choose Sync. In Synchronization, select Fetch to update the incoming commits list.
In Visual Studio 2015, if you do View History (from the Actions menu on the Changes panel in Team Explorer):
Then right click on the commit you're interested in:
You can create a branch from there:
I cannot see a way to just checkout to the commit in Visual Studio.
Working with the command line you can do a checkout of the commit SHA you want to use:
git checkout 9eab01d9
When you are done, just check out master again:
git checkout master
You might get warnings about working on a detached head, in that case you could create a branch temporarily:
git checkout -b temp-branch-name 9eab01d9
It is a good idea to get comfortable with the Git command line, the Visual Studio tooling is coming along, but it misses a lot of features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With